Uploaded image for project: 'Maven Surefire'
  1. Maven Surefire
  2. SUREFIRE-2073

Test class filtering should be done in the particular fork JVM where the real test would run.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 3.0.0-M6
    • None
    • JUnit 5.x support
    • None

    Description

      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:

      [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]

      Therefore Surefire should probably fork a new instance to scan for test classes whenever forkCount is not zero.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              pkarwasz Piotr Karwasz
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated: