Git Product home page Git Product logo

Comments (6)

BrynCooke avatar BrynCooke commented on July 20, 2024

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.

uvula avatar uvula commented on July 20, 2024

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.

BrynCooke avatar BrynCooke commented on July 20, 2024

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.

uvula avatar uvula commented on July 20, 2024

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.

BrynCooke avatar BrynCooke commented on July 20, 2024

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.

uvula avatar uvula commented on July 20, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.