If you unzip the attached project and run the test via Gradle, the container initialization fails with
WELD-ENV-000035: Class path entry does not exist or cannot be read: D:\Sourcecode\other\CDI-test\build\classes\java\test
java.lang.IllegalStateException: WELD-ENV-000035: Class path entry does not exist or cannot be read: D:\Sourcecode\other\CDI-test\build\classes\java\test
at org.jboss.weld.environment.deployment.discovery.ClassPathBeanArchiveScanner.scan(ClassPathBeanArchiveScanner.java:97)
at org.jboss.weld.environment.deployment.discovery.AbstractDiscoveryStrategy.performDiscovery(AbstractDiscoveryStrategy.java:113)
at org.jboss.weld.environment.se.Weld.createDeployment(Weld.java:955)
at org.jboss.weld.environment.se.Weld.initialize(Weld.java:777)
at org.jboss.weld.environment.se.Weld.initialize(Weld.java:176)
at net.kautler.cdi.alternatives.test.Test.test(Test.groovy:13)
This is, because some paths in the class path are not existing as there are actually no files in the respective source or resource directories, so they are not created by Gradle. If you open build.gradle.kts and comment-in the commented out lines that create those directories, the test runs through without problem. But imho WELD should more gracefully handle class path entries that do not exist and do not fail container initialization completely. |