Comments (6)
Hmmm, it looks like your are running Weld 1.0.1.
The cdi-unit dependency should be depending on 1.1.2
Was Weld 1.1.2 excluded in your pom?
from cdi-unit.
Hi Bryn, thanks for the quick response.
Yes, you are right, in my pom.xml is Weld 1.0.1 included.
I'm a beginner with maven. What repository must I use to get Weld 1.1.2?
Uwe / Germany
4.0.0
<groupId>ula.sandbox.weld</groupId>
<artifactId>weld-with-javase</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>weld-with-javase</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<repositories>
<repository>
<id>jglue-releases</id>
<name>jglue-releases</name>
<url>http://jglue.org/releases</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<releases />
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>jboss-public-repository</id>
<name>JBoss Repository</name>
<url>http://repository.jboss.org/nexus/content/groups/public</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.10</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.weld</groupId>
<artifactId>weld-se</artifactId>
<version>1.0.1-Final</version>
</dependency>
<dependency>
<groupId>org.jglue</groupId>
<artifactId>cdi-unit</artifactId>
<version>0.9.7</version>
<scope>test</scope>
</dependency>
</dependencies>
from cdi-unit.
I think you should be using:
<dependency>
<groupId>org.jboss.weld.se</groupId>
<artifactId>weld-se-core</artifactId>
<version>1.1.2.Final</version>
</dependency>
Remember to remove the 1.0.1-Final dependency.
from cdi-unit.
Hi Bryn,
yes, in the meantime I also found this solution. It also works with 1.1.3.SP1.
Maybe you can add this information to the web-page, so maven beginner have an easier start to use it.
(so maybe the xml (below) is not correct)
Uwe / Germany
<repositories>
<repository>
<id>jglue-releases</id>
<name>jglue-releases</name>
<url>http://jglue.org/releases</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<releases />
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>jboss-public-repository</id>
<name>JBoss Repository</name>
<url>http://repository.jboss.org/nexus/content/groups/public</url>
</repository>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.10</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.weld.se</groupId>
<artifactId>weld-se</artifactId>
<version>1.1.3.SP1</version>
</dependency>
<!-- <dependency> <groupId>org.jboss.weld.se</groupId> <artifactId>weld-se-core</artifactId>
<version>1.1.2.Final</version> </dependency> -->
<dependency>
<groupId>org.jglue</groupId>
<artifactId>cdi-unit</artifactId>
<version>0.9.7</version>
<scope>test</scope>
</dependency>
</dependencies>
from cdi-unit.
I'll add the information and also a runtime check to display something nice to the user instead of blowing up.
#3
Thanks for your feedback.
from cdi-unit.
Hi Bryn, I opened another issue.
Uwe
Hi,
I have another question. I'm beginning to use CDI with Java SE.
I have made a small test project (eclipse+maven+cdirunner).
I never read the CDI spec and I don't want to start a discussion
about Qualifier here.
I only tried to use the @nAmed annotation which I have seen
in other examples in the internet.
I have a:
- Interface Node
- Class RealNode
- A factory creating RealNodes named "rnode"
- Class JunitNode for testing
- A factory creating JunitNodes named "junit".
A Main call:
@Inject
@nAmed("jnode")
//@nAmed("rnode")
private Node node;
If I use the @nAmed in Main, I can toggle which factory is used.
In the JUnit test, I used the injection:
@Inject
@nAmed("jnode")
private Node node;
And it doesn't work, because I think the @nAmed "tag" is not considered.
Or must I used the CdiRunner in another way?
If I can attach a zip file, I will upload it, or send it be email to my last contact with you.
Uwe / Germany
from cdi-unit.
Related Issues (20)
- cdi-unit fails to build with JDK 14 HOT 1
- Maven is complaining about malformed projects
- Repository gardening
- Unable to run cdiunit on Zulu JDK 11 HOT 4
- CdiRunner does not unbind the BeanManager in finally HOT 1
- Migrate from TravisCI to GitHub Actions
- Setup release workflow with GitHub Actions HOT 10
- NoClassDefFoundError with JDK 11 HOT 4
- Version for Jakarta EE HOT 29
- Case sensitivity in URL comparison HOT 3
- Question: PowerMock Support?
- Release HOT 7
- Organization ownership continuity HOT 5
- Upgrade Maven
- Upgrade Deltaspike versions list HOT 1
- oss-parents is no longer active or supported.
- Servlet API 3.1+ is not supported HOT 2
- The joschi/setup-jdk GitHub Action is deprecated. Please consider switching to the official actions/setup-java action
- OpenRewrite recipes are missing
- jakarta.ee support for EE 10 / servlet api 6.0.0 HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cdi-unit.