-
1. Re: Changing WELD version for arquillian-testenricher-cdi
kpiwko Apr 7, 2014 3:44 AM (in response to rvadai)1 of 1 people found this helpfulHi Robert,
I Maven you can use <dependencyManagement> to solve these kind of situation. Put
<dependency> <groupId>org.jboss.weld</groupId> <artifactId>weld-core</artifactId> <version>1.1.9.Final</version> </dependency>
into <dependencies> in <dependencyManagement> section of your pom.xml file. Also make sure this is the first dependency there, or at least it is present before Arquillian BOM/ container relates dependencies. As first defined wins in Maven.
HTH,
Karel
-
2. Re: Changing WELD version for arquillian-testenricher-cdi
aslak Apr 7, 2014 10:41 AM (in response to rvadai)Arquillian does not expose Weld in an form or fashion. The dependency you're referring to is test scoped and won't be included when you're using it.
-
3. Re: Re: Changing WELD version for arquillian-testenricher-cdi
rvadai Apr 8, 2014 5:30 PM (in response to aslak)Thanks guys for the help.
I couldn't get it working with WELD, not even with adding <exclusions> to the pom.
The solution was to scrap the usage of the Instance class and use the Provider one instead.
@Inject @MyClassQualifier private Provider<MyClass> MyClassInstance;
Then I needed the annotation MyClassQualifier:
@Qualifier @Retention(RUNTIME) public @interface MyClassQualifier { }
I also needed the appropriate Producer method:
@Produces @MyClassQualifier public MyClass getNewMyClassInstance(@New MyClass myClassInstance) return myClassInstance; }
Thank you
-
4. Re: Re: Changing WELD version for arquillian-testenricher-cdi
aslak Apr 7, 2014 2:47 PM (in response to rvadai)You sure you didn't by accident import the Arquillian Instance class instead of the CDI one?