1 Reply Latest reply on Oct 4, 2012 5:34 AM by Gábor Farkas

    Do JUnit classes have to be in the same directory as main classes for weld to find all classes?

    Peter Raymond Newbie

      Hi, I'm using weld 1.1.8.Final with JUnit 4.10 to test in a Java SE environment.

       

      I use Maven to run tests but encounter the error below:

       

      WELD-001308 Unable to resolve any beans for Types: [class etc etc]

       

      If I put the test classes in the same directory as the main classes with an update to the POM as below everything works.

       

      <testOutputDirectory>${project.build.outputDirectory}</testOutputDirectory>

       

      Do  test and main classes have to be in the same directory ? Being on the classpath does not seem sufficient.

       

      I have the beans.xml location in META-INF and the class I am injecting annotated with @Alternative matching the beans.xml entry.

       

      Any advice would be helpful.

       

      Thanks

       

      Pete