apache / netbeans-mavenutils-nbm-maven-plugin

Apache NetBeans Maven Utils parent pom
https://netbeans.apache.org/
Apache License 2.0
13 stars 27 forks source link

nbm-maven-plugin does not work with Java 22 #159

Closed GuyDaniel closed 7 months ago

GuyDaniel commented 7 months ago

Any nbm module with code in it set to JDK 22 fails with : Execution default-manifest of goal org.apache.netbeans.utilities:nbm-maven-plugin:14.0:manifest failed: Unsupported class file major version 66 from directory = .... blah blah blah The last version of nbm-maven-plugin to work is 3.13.3 The newest version of the plugin - 14.0 does not, presumably as from about version 4.0 it started using the asm libraries. JDK 22 is quite new, and support for it probably only got included in the ASM release in March? This is easy to work around - just configure the nbm plugin as per:

<plugin>
    <groupId>org.apache.netbeans.utilities</groupId>
    <artifactId>nbm-maven-plugin</artifactId>
    <extensions>true</extensions>
    <dependencies>
        <dependency>
            <groupId>org.ow2.asm</groupId>
            <artifactId>asm</artifactId>
            <version>9.7</version>
        </dependency>
    </dependencies>
</plugin>         

I put this over in the netbeans issues by mistake and @mbien suggested that the project just needs to be rebuilt with updated dependencies.

mbien commented 7 months ago

@ebarboni to avoid this in future, I think we should do the following:

GuyDaniel commented 7 months ago

I created a sample nb module project with jdk22, ran maven with the --errors switch and attached the output here if that helps.

I haven't studied this project, but maybe it's a dependency of NetBeansManifestUpdateMojo, which uses org.apache.maven.shared.dependency.analyzer.asm.ASMDependencyAnalyzer, and then org.objectweb.asm.ClassReader?

mvn-build-debug.txt

GuyDaniel commented 7 months ago

I think dependabot is onto it over here ... https://github.com/apache/maven-dependency-analyzer/pull/112

ebarboni commented 7 months ago

thks for reporting. I was refactoring a bit pom in the project and encounter the issue. #161 use exclusion so we could manage our asm version.

ebarboni commented 7 months ago

For the records asm is often ahead release of jdk. But the maven-dependency-analyzer is often a bit late.

9.7 asm is for jdk 23 9.6 asm is for jdk 22

mbien commented 7 months ago

everyone is eagerly waiting for https://openjdk.org/jeps/457