Maven Release Plugin
  1. Maven Release Plugin
  2. MRELEASE-364

InvokerMavenExecutor fails with NPE if additional arguments are not set

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: 2.0-beta-8
    • Fix Version/s: 2.0-beta-8
    • Component/s: None
    • Labels:
      None
    • Number of attachments :
      9

      Description

      Attempting to perform a release:prepare fails with a simple pom:

      -bash-2.05b$ mvn release:prepare -DdryRun=true
      [INFO] Scanning for projects...
      [INFO] Searching repository for plugin with prefix: 'release'.
      [INFO] ------------------------------------------------------------------------
      [INFO] Building Test POM
      [INFO] task-segment: [release:prepare] (aggregator-style)
      [INFO] ------------------------------------------------------------------------
      [INFO] [release:prepare]
      [INFO] Verifying that there are no local modifications...
      [INFO] Executing: svn --non-interactive status
      [INFO] Working directory: /home/gilberts2/dev/maven_release_test
      [INFO] Checking dependencies and plugins for snapshots ...
      This project relies on a SNAPSHOT of the release plugin. This may be necessary d
      uring testing.: Do you want to continue with the release? (yes/no) no: : yes
      What is the release version for "Test POM"? (srg:test-pom) 1.0: :
      What is SCM release tag or label for "Test POM"? (srg:test-pom) test-pom-1.0: :
      What is the new development version for "Test POM"? (srg:test-pom) 1.1-SNAPSHOT:
      :
      [INFO] Transforming 'Test POM'...
      [INFO] Not generating release POMs
      [INFO] Executing preparation goals - since this is simulation mode it is running
      against the original project, not the rewritten ones
      [INFO] Executing goals 'clean verify'...
      [INFO] ------------------------------------------------------------------------
      [ERROR] BUILD ERROR
      [INFO] ------------------------------------------------------------------------
      [INFO] Cannot find Maven executor with id: null

      [INFO] ------------------------------------------------------------------------
      [INFO] For more information, run Maven with the -e switch
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: 11 seconds
      [INFO] Finished at: Tue Jul 22 23:34:07 EDT 2008
      [INFO] Final Memory: 22M/64M
      [INFO] ------------------------------------------------------------------------

      I attempted to set the mavenExecutorId to both:

      <configuration>
      <mavenExecutorId>forked-path</mavenExecutorId>
      </configuration>

      and

      <configuration>
      <mavenExecutorId>invoker</mavenExecutorId>
      </configuration>

      In both cases a NullPointerException was the result.

      The pom file is attached.

      1. forkedpath_executor_log.txt
        33 kB
        Steve Gilbert
      2. forkedpath_executor_pom.xml
        1 kB
        Steve Gilbert
      3. invalid_task_and_log.txt
        31 kB
        Steve Gilbert
      4. invoker_executor_log.txt
        30 kB
        Steve Gilbert
      5. invoker_executor_pom.xml
        1 kB
        Steve Gilbert
      6. invokermavenexecutor_null_pointer_exception.patch
        0.8 kB
        Steve Gilbert
      7. no_executor_log.txt
        30 kB
        Steve Gilbert
      8. no_executor_pom.xml
        1 kB
        Steve Gilbert
      9. pom.xml
        1 kB
        Steve Gilbert

        Issue Links

          Activity

          Hide
          Steve Gilbert added a comment -

          Now that I am past the NPE, I have a bizarre error about an invalid task "and" apparently when the child maven process is executed:

          [INFO] [INFO] ------------------------------------------------------------------------
          [INFO] [ERROR] BUILD FAILURE
          [INFO] [INFO] ------------------------------------------------------------------------
          [INFO] [INFO] Invalid task 'and': you must specify a valid lifecycle phase, or a goal in the format plugin:goal or pluginGroupId:pluginArtifactId:pluginVersion:goal
          [INFO] [INFO] ------------------------------------------------------------------------

          I've attached a full debug log.

          Show
          Steve Gilbert added a comment - Now that I am past the NPE, I have a bizarre error about an invalid task "and" apparently when the child maven process is executed: [INFO] [INFO] ------------------------------------------------------------------------ [INFO] [ERROR] BUILD FAILURE [INFO] [INFO] ------------------------------------------------------------------------ [INFO] [INFO] Invalid task 'and': you must specify a valid lifecycle phase, or a goal in the format plugin:goal or pluginGroupId:pluginArtifactId:pluginVersion:goal [INFO] [INFO] ------------------------------------------------------------------------ I've attached a full debug log.
          Hide
          Benjamin Bentmann added a comment -

          so I assumed you wanted a mvn run with "-X" even though you did not specify

          Oh yes, I forgot the most important part of the story. Thanks a lot for the logs!

          I've gotten around the NPE using the "invoker" mavenExecutor by modifying the code to handle the null string.

          Yep, that's it. I already have a concrete idea about the other issue with the NoSucheMethodError, too.

          I have a bizarre error about an invalid task "and"

          I bet this is from

          Building Maven user-level plugin registry from: 'C:\Documents and Settings\gilberts2\.m2\plugin-registry.xml'
          

          i.e. it doesn't properly handle spaces...

          Show
          Benjamin Bentmann added a comment - so I assumed you wanted a mvn run with "-X" even though you did not specify Oh yes, I forgot the most important part of the story. Thanks a lot for the logs! I've gotten around the NPE using the "invoker" mavenExecutor by modifying the code to handle the null string. Yep, that's it. I already have a concrete idea about the other issue with the NoSucheMethodError, too. I have a bizarre error about an invalid task "and" I bet this is from Building Maven user-level plugin registry from: 'C:\Documents and Settings\gilberts2\.m2\plugin-registry.xml' i.e. it doesn't properly handle spaces...
          Hide
          Steve Gilbert added a comment - - edited

          Excellent catch. It has to be that. I've gone back to Linux and with my patch in place to get past the NPE, I can now get through a prepare dry run.

          I can't change my home directory on the PC, so I have no workaround on the PC. I can't tell if the problem is in the release-manager/plugin code or somewhere else. I tried to run with

          -npr

          but that did not help since the problem is occurring in the child maven process and the parent's options are not passed to it. The same is true for debug output-- the child process doesn't log at debug level when I pass "-X" on the command line.

          Show
          Steve Gilbert added a comment - - edited Excellent catch. It has to be that. I've gone back to Linux and with my patch in place to get past the NPE, I can now get through a prepare dry run. I can't change my home directory on the PC, so I have no workaround on the PC. I can't tell if the problem is in the release-manager/plugin code or somewhere else. I tried to run with -npr but that did not help since the problem is occurring in the child maven process and the parent's options are not passed to it. The same is true for debug output-- the child process doesn't log at debug level when I pass "-X" on the command line.
          Hide
          Benjamin Bentmann added a comment -

          Applied patch to fix NPE in r679172, thanks Steve!

          As for the remaining issues, I opened distinct JIRA ticket: MRELEASE-365 and MRELEASE-366.

          Show
          Benjamin Bentmann added a comment - Applied patch to fix NPE in r679172 , thanks Steve! As for the remaining issues, I opened distinct JIRA ticket: MRELEASE-365 and MRELEASE-366 .
          Hide
          Benjamin Bentmann added a comment -

          Steve, regarding the "and" task: It's actually the path to the local repository that causes problems. You could edit your personal settings.xml and move the repo to a path without spaces.

          Also, the "forked-path" MavenExecutor is running again, so you could add "-DmavenExecutorId=forked-path" on the command line and try that instead of "invoker".

          The same is true for debug output-- the child process doesn't log at debug level when I pass "-X" on the command line.

          Most (if not all) options from the command line are not passed to the child build. To do so, you need to use the parameter arguments of the Release Plugin.

          Show
          Benjamin Bentmann added a comment - Steve, regarding the "and" task: It's actually the path to the local repository that causes problems. You could edit your personal settings.xml and move the repo to a path without spaces. Also, the "forked-path" MavenExecutor is running again, so you could add "-DmavenExecutorId=forked-path" on the command line and try that instead of "invoker". The same is true for debug output-- the child process doesn't log at debug level when I pass "-X" on the command line. Most (if not all) options from the command line are not passed to the child build. To do so, you need to use the parameter arguments of the Release Plugin.

            People

            • Assignee:
              Benjamin Bentmann
              Reporter:
              Steve Gilbert
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: