You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Andreas Pabst (Jira)" <ji...@apache.org> on 2022/12/30 21:06:00 UTC

[jira] [Created] (SUREFIRE-2139) Fully support Java 19 byte code

Andreas Pabst created SUREFIRE-2139:
---------------------------------------

             Summary: Fully support Java 19 byte code
                 Key: SUREFIRE-2139
                 URL: https://issues.apache.org/jira/browse/SUREFIRE-2139
             Project: Maven Surefire
          Issue Type: New Feature
          Components: classloading
            Reporter: Andreas Pabst


The examples from Surefire's [JPMS documentation|https://maven.apache.org/surefire/maven-surefire-plugin/examples/jpms.html] 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.

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.

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:

{code:xml}
<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>
{code}

To properly fix it, the ASM version could be set to 9.3 or 9.4 in the dependencyManagement section of the main pom.xml or 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.



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