-
Bug
-
Resolution: Done
-
Blocker
-
1.7.6.CR2, 1.11.0.ER1
-
False
-
False
-
+
-
Undefined
-
-
---
-
The "junit:junit" dependency is defined in productized "io.quarkus:quarkus-bom" as:
<dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <type>jar</type> <version>4.12</version> <scope>test</scope> </dependency>
The "quarkus-bom" dependency in upstream is not defining the junit4 dependency.
The product version of "quarkus-bom" should not do this either.
The problem is that if we use a "junit" dependant dependency like "testcontainers" with a scope different than "test":
<dependency> <groupId>org.testcontainers</groupId> <artifactId>testcontainers</artifactId> <scope>compile</scope> </dependency>
It will fail with:
java.lang.NoClassDefFoundError: org/junit/rules/TestRule at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:763) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) ...
This is caused because "quarkus-bom" is setting the "junit" dependency with scope "test".
The "quarkus-bom" dependency in upstream is not using the "junit" dependency. The product version of "quarkus-bom" should not do this either.
Note that this is not a regression issue entered in 1.11.0.ER1, but it's also happening in previous releases.