Uploaded image for project: 'Maven Dependency Plugin'
  1. Maven Dependency Plugin
  2. MDEP-364

'tree' goal fails with an NPE if a project uses version ranges for dependencies

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Cannot Reproduce
    • 2.4
    • None
    • tree
    • None

    Description

      We have bound execution of dependency:tree to the verify phase in the parent POM for all of our projects. That way, maven always dumps a complete tree of dependencies for a project after it's been fully packaged and before it's installed/deployed.

      The plugin set-up looks like this:

      <plugin>
          <inherited>true</inherited>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-dependency-plugin</artifactId>
          <version>2.4</version>
          <executions>
              <execution>
                  <!-- Output dependency tree at the end of build process -->
                  <id>display-dependency-tree</id>
                  <phase>verify</phase>
                  <goals>
                      <goal>tree</goal>
                  </goals>
              </execution>
          </executions>
      </plugin>
      

      Today it failed sporadically with an NPE during a routine CI build in Jenkins.
      Maven options for Jenkins:

      -B --settings /home/xxxxxxxx/.m2/settings-jenkins-releases.xml -U clean verify

      The stack trace is below:

      org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:2.4:tree (display-dependency-tree) on project liquidity-common-server: Execution display-dependency-tree of goal org.apache.maven.plugins:maven-dependency-plugin:2.4:tree failed.
      	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:225)
      	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
      	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
      	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
      	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
      	at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
      	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
      	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
      	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
      	at org.jvnet.hudson.maven3.launcher.Maven3Launcher.main(Maven3Launcher.java:79)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      	at java.lang.reflect.Method.invoke(Method.java:597)
      	at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:329)
      	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:239)
      	at org.jvnet.hudson.maven3.agent.Maven3Main.launch(Maven3Main.java:158)
      	at hudson.maven.Maven3Builder.call(Maven3Builder.java:98)
      	at hudson.maven.Maven3Builder.call(Maven3Builder.java:64)
      	at hudson.remoting.UserRequest.perform(UserRequest.java:118)
      	at hudson.remoting.UserRequest.perform(UserRequest.java:48)
      	at hudson.remoting.Request$2.run(Request.java:287)
      	at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
      	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      	at java.lang.Thread.run(Thread.java:662)
      Caused by: org.apache.maven.plugin.PluginExecutionException: Execution display-dependency-tree of goal org.apache.maven.plugins:maven-dependency-plugin:2.4:tree failed.
      	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:110)
      	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
      	... 27 more
      Caused by: java.lang.NullPointerException
      	at org.apache.maven.artifact.DefaultArtifact.equals(DefaultArtifact.java:344)
      	at org.apache.maven.shared.dependency.tree.DependencyNode.equals(DependencyNode.java:811)
      	at org.apache.maven.shared.dependency.tree.filter.AncestorOrSelfDependencyNodeFilter.isAncestorOrSelf(AncestorOrSelfDependencyNodeFilter.java:103)
      	at org.apache.maven.shared.dependency.tree.filter.AncestorOrSelfDependencyNodeFilter.accept(AncestorOrSelfDependencyNodeFilter.java:76)
      	at org.apache.maven.shared.dependency.tree.traversal.FilteringDependencyNodeVisitor.visit(FilteringDependencyNodeVisitor.java:72)
      	at org.apache.maven.shared.dependency.tree.DependencyNode.accept(DependencyNode.java:305)
      	at org.apache.maven.shared.dependency.tree.DependencyNode.accept(DependencyNode.java:313)
      	at org.apache.maven.shared.dependency.tree.DependencyNode.accept(DependencyNode.java:313)
      	at org.apache.maven.plugin.dependency.TreeMojo.serializeDependencyTree(TreeMojo.java:376)
      	at org.apache.maven.plugin.dependency.TreeMojo.execute(TreeMojo.java:277)
      	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
      	... 28 more
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              sergei_ivanov@mail.ru Sergei S. Ivanov
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: