maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Luciano van der Veekens (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (MSHARED-660) Upgrade to asm 6.0 for JDK9
Date Fri, 20 Oct 2017 07:40:00 GMT

    [ https://issues.apache.org/jira/browse/MSHARED-660?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16212289#comment-16212289
] 

Luciano van der Veekens commented on MSHARED-660:
-------------------------------------------------

I am encountering the following exception when using _maven-dependency-plugin:1.7_ in combination
with _asm:6.0_.

{code}
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:nbm-maven-plugin:4.1:manifest
(default-manifest) on project ncc.wrapper-netinium: Execution default-manifest of goal org.codehaus.mojo:nbm-maven-plugin:4.1:manifest
failed.
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:154)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:146)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
	at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:309)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:194)
	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:107)
	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:993)
	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:345)
	at org.apache.maven.cli.MavenCli.main(MavenCli.java:191)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-manifest of
goal org.codehaus.mojo:nbm-maven-plugin:4.1:manifest failed.
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:145)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
	... 20 more
Caused by: java.lang.RuntimeException
	at org.objectweb.asm.ClassVisitor.visitModule(ClassVisitor.java:148)
	at org.objectweb.asm.ClassReader.readModule(ClassReader.java:731)
	at org.objectweb.asm.ClassReader.accept(ClassReader.java:632)
	at org.objectweb.asm.ClassReader.accept(ClassReader.java:500)
	at org.apache.maven.shared.dependency.analyzer.asm.DependencyClassFileVisitor.visitClass(DependencyClassFileVisitor.java:74)
	at org.apache.maven.shared.dependency.analyzer.ClassFileVisitorUtils.visitClass(ClassFileVisitorUtils.java:163)
	at org.apache.maven.shared.dependency.analyzer.ClassFileVisitorUtils.acceptJar(ClassFileVisitorUtils.java:107)
	at org.apache.maven.shared.dependency.analyzer.ClassFileVisitorUtils.accept(ClassFileVisitorUtils.java:61)
	at org.apache.maven.shared.dependency.analyzer.asm.ASMDependencyAnalyzer.analyze(ASMDependencyAnalyzer.java:50)
	at org.codehaus.mojo.nbm.NetBeansManifestUpdateMojo.buildDependencyClasses(NetBeansManifestUpdateMojo.java:920)
	at org.codehaus.mojo.nbm.NetBeansManifestUpdateMojo.buildProjectDependencyClasses(NetBeansManifestUpdateMojo.java:763)
	at org.codehaus.mojo.nbm.NetBeansManifestUpdateMojo.checkModuleClassPath(NetBeansManifestUpdateMojo.java:667)
	at org.codehaus.mojo.nbm.NetBeansManifestUpdateMojo.execute(NetBeansManifestUpdateMojo.java:530)
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
	... 21 more
{code}

The relevant source of the ASM library: 

{code}
public ModuleVisitor visitModule(String name, int access, String version) {
    if (api < Opcodes.ASM6) {
        throw new RuntimeException();
    }
    if (cv != null) {
        return cv.visitModule(name, access, version);
    }
    return null;
}
{code}

At the point of failing the implementation of {{org.objectweb.asm.ClassVisitor}} is {{org.apache.maven.shared.dependency.analyzer.asm.DefaultClassVisitor}}
which initializes the visitor using {{Opcodes.ASM5}}.

{code}
public DefaultClassVisitor( SignatureVisitor signatureVisitor, AnnotationVisitor annotationVisitor,
	                                FieldVisitor fieldVisitor, MethodVisitor methodVisitor,
	                                ResultCollector resultCollector )  
{
    super( Opcodes.ASM5 );
    this.signatureVisitor = signatureVisitor;
    this.annotationVisitor = annotationVisitor;
    this.fieldVisitor = fieldVisitor;
    this.methodVisitor = methodVisitor;
    this.resultCollector = resultCollector;
}
{code}

I noticed the latest _maven-dependency-analyzer:1.8-SNAPSHOT_ still initializes the visitor
this way. Doesn't it need to use {{Opcodes.ASM6}} now?

> Upgrade to asm 6.0 for JDK9
> ---------------------------
>
>                 Key: MSHARED-660
>                 URL: https://issues.apache.org/jira/browse/MSHARED-660
>             Project: Maven Shared Components
>          Issue Type: Dependency upgrade
>          Components: maven-dependency-analyzer
>    Affects Versions: maven-dependency-analyzer-1.7
>            Reporter: Karl Heinz Marbaise
>            Assignee: Robert Scholte
>            Priority: Critical
>             Fix For: maven-dependency-analyzer-1.8
>
>
> We need to upgrade the org.ow2.asm:asm dependency to 6.0 to support more JDK 9 in maven-dependency-plugin.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message