[ https://issues.apache.org/jira/browse/MASSEMBLY-923?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16996562#comment-16996562 ]
Karl Heinz Marbaise edited comment on MASSEMBLY-923 at 12/14/19 9:03 PM: ------------------------------------------------------------------------- The first thing you see in that build is a WARNING {code} [WARNING] The artifact axis:axis-ant:jar:1.4 has been relocated to org.apache.axis:axis-ant:jar:1.4 {code} This results that the jar file is not being downloaded to local repository. In the end this the issue [that the artifact is a relocation|https://search.maven.org/artifact/axis/axis-ant/1.4/jar] and not a real artifact. If you take a look into the [given pom file|https://repo1.maven.org/maven2/axis/axis-ant/1.4/axis-ant-1.4.pom] which looks like this: {code:xml} <project> <modelVersion>4.0.0</modelVersion> <groupId>axis</groupId> <artifactId>axis-ant</artifactId> <version>1.4</version> <distributionManagement> <relocation> <groupId>org.apache.axis</groupId> </relocation> </distributionManagement> </project> {code} If you change the groupId to the correct one (see WARNING) of the dependency the given example works perfect. So the question is: Can we somehow identify such situation in maven assembly plugin? was (Author: khmarbaise): It is caused by that the given [artifact contains an relocation|https://search.maven.org/artifact/axis/axis-ant/1.4/jar] and not a real artifact. If you take a look into the [given pom file|https://repo1.maven.org/maven2/axis/axis-ant/1.4/axis-ant-1.4.pom] which looks like this: {code:xml} <project> <modelVersion>4.0.0</modelVersion> <groupId>axis</groupId> <artifactId>axis-ant</artifactId> <version>1.4</version> <distributionManagement> <relocation> <groupId>org.apache.axis</groupId> </relocation> </distributionManagement> </project> {code} If you change the groupId of the dependency the given example works perfect. So the question is: Can we somehow identify such situation in maven assembly plugin? > NPE when axis:axis-ant:1.4 is part of dependencySet > --------------------------------------------------- > > Key: MASSEMBLY-923 > URL: https://issues.apache.org/jira/browse/MASSEMBLY-923 > Project: Maven Assembly Plugin > Issue Type: Bug > Components: dependencySet > Affects Versions: 3.1.1, 3.2.0 > Reporter: Václav Haisman > Priority: Critical > > I can reproduce a NPE when axis:axis-ant:1.4 is part of dependencySet. See > GitHub repository [https://github.com/wilx/maven-assembly-plugin-npe] for > easy reproduction. Just run mvn clean install. It appears to be caused by the > POM format of the axis-ant as it is installed in Maven Central. This was > tested with Maven 3.6.2. > > {noformat} > [ERROR] Failed to execute goal > org.apache.maven.plugins:maven-assembly-plugin:3.2.0:single (default) on > project maven-assembly-plugin-npe: Execution default of goal > org.apache.maven.plugins:maven-assembly-plugin:3.2.0:single failed.: > NullPointerException -> [Help 1] > org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute > goal org.apache.maven.plugins:maven-assembly-plugin:3.2.0:single (default) on > project maven-assembly-plugin-npe: Execution default of goal > org.apache.maven.plugins:maven-assembly-plugin:3.2.0:single failed. > at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:215) > at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:156) > at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:148) > 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:56) > at org.apache.maven.lifecycle.internal.LifecycleStarter.execute > (LifecycleStarter.java:128) > at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305) > at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192) > at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105) > at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956) > at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288) > at org.apache.maven.cli.MavenCli.main (MavenCli.java:192) > at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) > at jdk.internal.reflect.NativeMethodAccessorImpl.invoke > (NativeMethodAccessorImpl.java:62) > at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke > (DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke (Method.java:566) > at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced > (Launcher.java:282) > at org.codehaus.plexus.classworlds.launcher.Launcher.launch > (Launcher.java:225) > at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode > (Launcher.java:406) > at org.codehaus.plexus.classworlds.launcher.Launcher.main > (Launcher.java:347) > Caused by: org.apache.maven.plugin.PluginExecutionException: Execution > default of goal org.apache.maven.plugins:maven-assembly-plugin:3.2.0:single > failed. > at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo > (DefaultBuildPluginManager.java:148) > at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:210) > at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:156) > at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:148) > 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:56) > at org.apache.maven.lifecycle.internal.LifecycleStarter.execute > (LifecycleStarter.java:128) > at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305) > at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192) > at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105) > at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956) > at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288) > at org.apache.maven.cli.MavenCli.main (MavenCli.java:192) > at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) > at jdk.internal.reflect.NativeMethodAccessorImpl.invoke > (NativeMethodAccessorImpl.java:62) > at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke > (DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke (Method.java:566) > at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced > (Launcher.java:282) > at org.codehaus.plexus.classworlds.launcher.Launcher.launch > (Launcher.java:225) > at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode > (Launcher.java:406) > at org.codehaus.plexus.classworlds.launcher.Launcher.main > (Launcher.java:347) > Caused by: java.lang.NullPointerException > at > org.apache.maven.plugins.assembly.archive.archiver.AssemblyProxyArchiver$DefaultFileInfo.isFile > (AssemblyProxyArchiver.java:1024) > at > org.apache.maven.plugins.assembly.filter.ComponentsXmlArchiverFileFilter.isSelected > (ComponentsXmlArchiverFileFilter.java:179) > at > org.apache.maven.plugins.assembly.archive.archiver.AssemblyProxyArchiver.acceptFile > (AssemblyProxyArchiver.java:793) > at > org.apache.maven.plugins.assembly.archive.archiver.AssemblyProxyArchiver.addFile > (AssemblyProxyArchiver.java:417) > at org.apache.maven.plugins.assembly.archive.task.AddArtifactTask.asFile > (AddArtifactTask.java:175) > at org.apache.maven.plugins.assembly.archive.task.AddArtifactTask.execute > (AddArtifactTask.java:132) > at > org.apache.maven.plugins.assembly.archive.task.AddDependencySetsTask.addNormalArtifact > (AddDependencySetsTask.java:263) > at > org.apache.maven.plugins.assembly.archive.task.AddDependencySetsTask.addDependencySet > (AddDependencySetsTask.java:175) > at > org.apache.maven.plugins.assembly.archive.task.AddDependencySetsTask.execute > (AddDependencySetsTask.java:120) > at > org.apache.maven.plugins.assembly.archive.phase.DependencySetAssemblyPhase.execute > (DependencySetAssemblyPhase.java:104) > at > org.apache.maven.plugins.assembly.archive.DefaultAssemblyArchiver.createArchive > (DefaultAssemblyArchiver.java:182) > at org.apache.maven.plugins.assembly.mojos.AbstractAssemblyMojo.execute > (AbstractAssemblyMojo.java:488) > at org.apache.maven.plugins.assembly.mojos.SingleAssemblyMojo.execute > (SingleAssemblyMojo.java:61) > at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo > (DefaultBuildPluginManager.java:137) > at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:210) > at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:156) > at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:148) > 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:56) > at org.apache.maven.lifecycle.internal.LifecycleStarter.execute > (LifecycleStarter.java:128) > at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305) > at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192) > at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105) > at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956) > at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288) > at org.apache.maven.cli.MavenCli.main (MavenCli.java:192) > at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) > at jdk.internal.reflect.NativeMethodAccessorImpl.invoke > (NativeMethodAccessorImpl.java:62) > at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke > (DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke (Method.java:566) > at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced > (Launcher.java:282) > at org.codehaus.plexus.classworlds.launcher.Launcher.launch > (Launcher.java:225) > at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode > (Launcher.java:406) > at org.codehaus.plexus.classworlds.launcher.Launcher.main > (Launcher.java:347) > {noformat} -- This message was sent by Atlassian Jira (v8.3.4#803005)