Skip to content

[SUREFIRE-2139] Fully support Java 19 byte code #2759

@jira-importer

Description

@jira-importer

Andreas Pabst opened SUREFIRE-2139 and commented

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

Remote Links:

Metadata

Metadata

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions