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:15:00 UTC

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

     [ https://issues.apache.org/jira/browse/SUREFIRE-2139?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andreas Pabst updated SUREFIRE-2139:
------------------------------------
    Description: 
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.

h3. 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.

h3. 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:

{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}

h3. 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).

  was:
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.


> 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
>            Priority: Major
>              Labels: jdk19, jigsaw, jpms
>
> 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.
> h3. 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.
> h3. 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:
> {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}
> h3. 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).



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