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

Fully support Java 19 byte code

    XMLWordPrintableJSON

Details

    Description

      The examples from Surefire's JPMS documentation do not work if they are compiled with language level 19.

      This behaviour can also be reproduced by executing the JPMS-related ITs with Java 19, for example MultiModuleProjectWithJPMSIT.

      Root cause

      The root cause appears to be an ASM 9.2 dependency that does not support Java 19 bytecode. The ASM dependency comes in transitively via plexus-java 1.1.1.

      Workaround

      A workaround for 3.0.0-M7 users is to explicitly add an ASM 9.3 or 9.4 dependency to the maven-surefire-plugin configuration like this:

      <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>3.0.0-M7</version>
          <dependencies>
              <dependency>
                  <groupId>org.ow2.asm</groupId>
                  <artifactId>asm</artifactId>
                  <version>9.3</version>
              </dependency>
          </dependencies>
      </plugin>
      

      Options for fixing

      To properly fix it there are two options:

      1. The ASM version could be set to 9.3 or 9.4 in the dependencyManagement section of the main pom.xml
      2. The plexus-java dependency in maven-surefire-common could be upgraded to an as of now yet to be released new version of plexus-java that brings in ASM in version 9.4 (master branch already has it).

      Attachments

        Issue Links

          Activity

            People

              sjaranowski Slawomir Jaranowski
              andpab Andreas Pabst
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: