Hi, 
Asm  9.6 is adding jdk22 constant but we have 9.5 in nbm by transitivity that 
should be jdk 21. But you may have code that bug asm 9.5 too.

+1 to mbien to have a reproducer if you have one.
+1 to make direct dependency to avoid waiting for maven-dependency-analyzer 
upgrade.

Best Regards
Eric

-----Message d'origine-----
De : Michael Bien <mbie...@gmail.com> 
Envoyé : vendredi 24 novembre 2023 13:38
À : dev@netbeans.apache.org; Patrik Karlström <pat...@trixon.se>
Objet : Re: Build failure with nbm-maven-plugin:14.0

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.buildProjec
> t
> (LifecycleModuleBuilder.java:105)
>
>      at
> org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProjec
> t
> (LifecycleModuleBuilder.java:73)
>
>      at
> org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThrea
> dedBuilder.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.checkModuleClassPat
> h
> (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.buildProjec
> t
> (LifecycleModuleBuilder.java:105)
>
>      at
> org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProjec
> t
> (LifecycleModuleBuilder.java:73)
>
>      at
> org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThrea
> dedBuilder.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





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



Reply via email to