Uploaded image for project: 'Maven Remote Resources Plugin'
  1. Maven Remote Resources Plugin
  2. MRRESOURCES-58

'process' goal fails with NPE at the root of a reactor if child modules use version ranges for dependencies

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.2.1, 1.3
    • 1.5
    • None
    • Patch

    Description

      When the maven-remote-resources-plugin:process goal is integrated into the lifecycle of a parent project in a multi-module reactor build, the goal fails with an NPE if dependency version ranges are used in the child modules. Additionally, "runOnlyAtExecutionRoot" option needs to be set to true in order to recreate the problem. Please see the attached test project that demonstrates the problem.

      Full exception trace is as follows:

      [ERROR] Failed to execute goal org.apache.maven.plugins:maven-remote-resources-plugin:1.2.1:process (process-remote-resources) on project test-parent: Execution process-remote-resources of goal org.apache.maven.plugins:maven-remote-resources-plugin:1.2.1:process failed. NullPointerException -> [Help 1]
      org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-remote-resources-plugin:1.2.1:process (process-remote-resources) on project test-parent: Execution process-remote-resources of goal org.apache.maven.plugins:maven-remote-resources-plugin:1.2.1:process 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:319)
      	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
      	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
      	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
      	at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
      	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.launchEnhanced(Launcher.java:290)
      	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
      	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
      	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
      	at org.codehaus.classworlds.Launcher.main(Launcher.java:47)
      	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 com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
      Caused by: org.apache.maven.plugin.PluginExecutionException: Execution process-remote-resources of goal org.apache.maven.plugins:maven-remote-resources-plugin:1.2.1:process failed.
      	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:110)
      	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
      	... 25 more
      Caused by: java.lang.NullPointerException
      	at org.apache.maven.artifact.DefaultArtifact.equals(DefaultArtifact.java:344)
      	at java.util.HashMap.put(HashMap.java:376)
      	at java.util.HashSet.add(HashSet.java:200)
      	at java.util.AbstractCollection.addAll(AbstractCollection.java:305)
      	at org.apache.maven.plugin.resources.remote.ProcessRemoteResourcesMojo.aggregateProjectDependencyArtifacts(ProcessRemoteResourcesMojo.java:749)
      	at org.apache.maven.plugin.resources.remote.ProcessRemoteResourcesMojo.getProjects(ProcessRemoteResourcesMojo.java:624)
      	at org.apache.maven.plugin.resources.remote.ProcessRemoteResourcesMojo.configureVelocityContext(ProcessRemoteResourcesMojo.java:988)
      	at org.apache.maven.plugin.resources.remote.ProcessRemoteResourcesMojo.execute(ProcessRemoteResourcesMojo.java:511)
      	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
      	... 26 more

      Attachments

        1. version-ranges-bugfix-v2.patch
          3 kB
          Sergei Ivanov
        2. version-ranges-bugfix.patch
          2 kB
          Sergei Ivanov
        3. test-reactor-version-ranges.zip
          2 kB
          Sergei Ivanov

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: