Hi Patrik,
I quickly checked and the nbm-maven-plugin doesn't directly depend on
ASM but uses it transitively. We should probably add it directly and
keep it up2date to avoid things like this in future.
Updating ASM is usually safe - it is also one of the first libs which
break when the JDK updates (or if you try to rise the language level).
It is a good sign that adding it as dependency worked for you, since ASM
is often shaded by third party libs which would make this not possible.
JDK is working on a classfile api (JEP 457, JDK 22) - this will
hopefully solve issues like this over the long term - but this will take
a while. It is not uncommon that a dusty projects ships with 5+ versions
of ASM which is the first hurdle of an JDK upgrade.
I think Eric mentioned that he had initially issues with JDK 21, but we
both couldn't reproduce it anymore after updating dependencies so we
thought it got solved in 14.0.
if you can come up with a reproducer, please create an issue against:
https://github.com/apache/netbeans-mavenutils-nbm-maven-plugin
best regards,
-mbien
On 24.11.23 12:58, Patrik Karlström wrote:
I switched to nbm-maven-plugin:14.0 to use Java 21 for my project on
NB20-rc4 yesterday and initially it worked fine.
Today I got a build failure in 1 of 60 modules that I solved with this
dependency.
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm</artifactId>
<version>9.6</version>
</dependency>
Is that normal, is it me or something with nbm-maven-plugin?
Patrik
BUILD FAILURE
------------------------------------------------------------------------
Total time: 5.846 s
Finished at: 2023-11-24T11:38:31+01:00
------------------------------------------------------------------------
Failed to execute goal
org.apache.netbeans.utilities:nbm-maven-plugin:14.0:manifest
(default-manifest) on project butterfly-core: Uncategorized problems with
NetBeans dependency verification (maybe MNBMODULE-102 or wrong maven
dependency metadata). Supposedly external classes are used in the project's
binaries but the classes are not found on classpath. Class usages:
[org.objectweb.asm.Opcodes, org.objectweb.asm.Label,
org.objectweb.asm.Type, org.objectweb.asm.MethodVisitor,
org.objectweb.asm.ClassReader, org.objectweb.asm.AnnotationVisitor,
org.objectweb.asm.Attribute, org.objectweb.asm.ClassVisitor,
org.objectweb.asm.FieldVisitor] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute
goal org.apache.netbeans.utilities:nbm-maven-plugin:14.0:manifest
(default-manifest) on project butterfly-core: Uncategorized problems with
NetBeans dependency verification (maybe MNBMODULE-102 or wrong maven
dependency metadata). Supposedly external classes are used in the project's
binaries but the classes are not found on classpath. Class usages:
[org.objectweb.asm.Opcodes, org.objectweb.asm.Label,
org.objectweb.asm.Type, org.objectweb.asm.MethodVisitor,
org.objectweb.asm.ClassReader, org.objectweb.asm.AnnotationVisitor,
org.objectweb.asm.Attribute, org.objectweb.asm.ClassVisitor,
org.objectweb.asm.FieldVisitor]
at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2
(MojoExecutor.java:333)
at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute
(MojoExecutor.java:316)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute
(MojoExecutor.java:212)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute
(MojoExecutor.java:174)
at org.apache.maven.lifecycle.internal.MojoExecutor.access$000
(MojoExecutor.java:75)
at org.apache.maven.lifecycle.internal.MojoExecutor$1.run
(MojoExecutor.java:162)
at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute
(DefaultMojosExecutionStrategy.java:39)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute
(MojoExecutor.java:159)
at
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject
(LifecycleModuleBuilder.java:105)
at
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject
(LifecycleModuleBuilder.java:73)
at
org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build
(SingleThreadedBuilder.java:53)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute
(LifecycleStarter.java:118)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:261)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:173)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:101)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:906)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:283)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:206)
at jdk.internal.reflect.DirectMethodHandleAccessor.invoke
(DirectMethodHandleAccessor.java:103)
at java.lang.reflect.Method.invoke (Method.java:580)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced
(Launcher.java:283)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch
(Launcher.java:226)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode
(Launcher.java:407)
at org.codehaus.plexus.classworlds.launcher.Launcher.main
(Launcher.java:348)
Caused by: org.apache.maven.plugin.MojoFailureException: Uncategorized
problems with NetBeans dependency verification (maybe MNBMODULE-102 or
wrong maven dependency metadata). Supposedly external classes are used in
the project's binaries but the classes are not found on classpath. Class
usages: [org.objectweb.asm.Opcodes, org.objectweb.asm.Label,
org.objectweb.asm.Type, org.objectweb.asm.MethodVisitor,
org.objectweb.asm.ClassReader, org.objectweb.asm.AnnotationVisitor,
org.objectweb.asm.Attribute, org.objectweb.asm.ClassVisitor,
org.objectweb.asm.FieldVisitor]
at
org.apache.netbeans.nbm.NetBeansManifestUpdateMojo.checkModuleClassPath
(NetBeansManifestUpdateMojo.java:759)
at org.apache.netbeans.nbm.NetBeansManifestUpdateMojo.execute
(NetBeansManifestUpdateMojo.java:545)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo
(DefaultBuildPluginManager.java:126)
at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2
(MojoExecutor.java:328)
at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute
(MojoExecutor.java:316)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute
(MojoExecutor.java:212)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute
(MojoExecutor.java:174)
at org.apache.maven.lifecycle.internal.MojoExecutor.access$000
(MojoExecutor.java:75)
at org.apache.maven.lifecycle.internal.MojoExecutor$1.run
(MojoExecutor.java:162)
at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute
(DefaultMojosExecutionStrategy.java:39)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute
(MojoExecutor.java:159)
at
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject
(LifecycleModuleBuilder.java:105)
at
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject
(LifecycleModuleBuilder.java:73)
at
org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build
(SingleThreadedBuilder.java:53)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute
(LifecycleStarter.java:118)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:261)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:173)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:101)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:906)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:283)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:206)
at jdk.internal.reflect.DirectMethodHandleAccessor.invoke
(DirectMethodHandleAccessor.java:103)
at java.lang.reflect.Method.invoke (Method.java:580)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced
(Launcher.java:283)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch
(Launcher.java:226)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode
(Launcher.java:407)
at org.codehaus.plexus.classworlds.launcher.Launcher.main
(Launcher.java:348)
Re-run Maven using the -X switch to enable full debug logging.
For more information about the errors and possible solutions, please read
the following articles:
[Help 1]
http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@netbeans.apache.org
For additional commands, e-mail: dev-h...@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists