[ 
https://issues.apache.org/jira/browse/SUREFIRE-2073?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17522734#comment-17522734
 ] 

Piotr Karwasz commented on SUREFIRE-2073:
-----------------------------------------

[~tibordigana],

Thank you for your fast answer. In the end I was able to work around this 
limitation by compiling all test classes with Maven's default JVM (Java 8 in my 
case) and use a separate source folder for {{{}module-info.java{}}}.

However in the long run I would like to solve the problem properly. The new 
design you are referring to is the one from SUREFIRE-2049? Are there some 
subtasks of this new design that are open to external contributors?

> Surefire should fork before class scan
> --------------------------------------
>
>                 Key: SUREFIRE-2073
>                 URL: https://issues.apache.org/jira/browse/SUREFIRE-2073
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: JUnit 5.x support
>    Affects Versions: 3.0.0-M6
>            Reporter: Piotr Karwasz
>            Priority: Major
>
> On projects using toolchains submodules can be compiled with a different Java 
> version than the main project. This can result in an 
> {{UnsupportedClassVersionError}} if the class scan is performed by the main 
> Maven JVM:
> {noformat}
> [ERROR] Failed to execute goal 
> org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M5:test (test) on 
> project log4j-api-java9: Execution test of goal 
> org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M5:test failed: 
> java.lang.UnsupportedClassVersionError: 
> org/apache/logging/log4j/util/java9/ProcessIdUtilTest has been compiled by a 
> more recent version of the Java Runtime (class file version 53.0), this 
> version of the Java Runtime only recognizes class file versions up to 52.0 -> 
> [Help 1]{noformat}
> Therefore Surefire should probably fork a new instance to scan for test 
> classes whenever {{forkCount}} is not zero.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to