Henning Schmiedehausen created SUREFIRE-2191:
------------------------------------------------

             Summary: surefire crashes on a JPMS modularized project that uses 
junit5
                 Key: SUREFIRE-2191
                 URL: https://issues.apache.org/jira/browse/SUREFIRE-2191
             Project: Maven Surefire
          Issue Type: Bug
          Components: JUnit 5.x support, process forking
    Affects Versions: 3.1.2
            Reporter: Henning Schmiedehausen


clone this repository: [https://github.com/hgschmie/surefire-2191 
|https://github.com/hgschmie/surefire-2191] and build it.

The build fails during testing with a large and cryptic error description.  The 
code only uses the junit jupiter APIs and imports the with {{  requires 
transitive org.junit.jupiter.api;}}

This is the surefireargs file that the plugin creates:

{code}
--module-path
"/Users/henning/scratch/surefire-junit-bug/target/classes:/Users/henning/.m2/repository/org/junit/jupiter/junit-jupiter-api/5.10.0/junit-jupiter-api-5.10.0.jar:/Users/henning/.m2/repository/org/opentest4j/opentest4j/1.3.0/opentest4j-1.3.0.jar:/Users/henning/.m2/repository/org/junit/platform/junit-platform-commons/1.10.0/junit-platform-commons-1.10.0.jar:/Users/henning/.m2/repository/org/apiguardian/apiguardian-api/1.1.2/apiguardian-api-1.1.2.jar"
--class-path
"/Users/henning/.m2/repository/org/apache/maven/surefire/surefire-api/3.1.2/surefire-api-3.1.2.jar:/Users/henning/.m2/repository/org/apache/maven/surefire/surefire-booter/3.1.2/surefire-booter-3.1.2.jar:/Users/henning/.m2/repository/org/apache/maven/surefire/surefire-extensions-spi/3.1.2/surefire-extensions-spi-3.1.2.jar:/Users/henning/.m2/repository/org/apache/maven/surefire/surefire-logger-api/3.1.2/surefire-logger-api-3.1.2.jar:/Users/henning/.m2/repository/org/apache/maven/surefire/surefire-shared-utils/3.1.2/surefire-shared-utils-3.1.2.jar:/Users/henning/scratch/surefire-junit-bug/target/test-classes:/Users/henning/.m2/repository/org/assertj/assertj-core/3.24.2/assertj-core-3.24.2.jar:/Users/henning/.m2/repository/net/bytebuddy/byte-buddy/1.12.21/byte-buddy-1.12.21.jar:/Users/henning/.m2/repository/org/apache/maven/surefire/surefire-junit-platform/3.1.2/surefire-junit-platform-3.1.2.jar:/Users/henning/.m2/repository/org/apache/maven/surefire/common-java5/3.1.2/common-java5-3.1.2.jar:/Users/henning/.m2/repository/org/junit/platform/junit-platform-launcher/1.10.0/junit-platform-launcher-1.10.0.jar:/Users/henning/.m2/repository/org/junit/platform/junit-platform-engine/1.10.0/junit-platform-engine-1.10.0.jar:/Users/henning/.m2/repository/org/junit/jupiter/junit-jupiter-engine/5.10.0/junit-jupiter-engine-5.10.0.jar"
--patch-module
surefire.junit.bug="/Users/henning/scratch/surefire-junit-bug/target/test-classes"
--add-opens
surefire.junit.bug/demo=ALL-UNNAMED
--add-modules
surefire.junit.bug
--add-reads
surefire.junit.bug=ALL-UNNAMED
org.apache.maven.surefire.booter.ForkedBooter
{code}

It is not clear to me on how to fix/mitigate this error. The same build works 
fine without JPMS modules or with automatic versioned modules.




--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to