Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-8608

release plugin changes maven goals if an error occurs

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • m2release-plugin
    • None
    • linux hudson running stand-alone, proxied behind apache. Hudson version 1.394, release plugin 0.6.1

      We set up a new project and performed a build which succeeded. After that, I scheduled a maven release. it failed with this error:
      Found mavenVersion 2.2.1 from file jar:file:/var/lib/hudson/tools/Maven2/lib/maven-2.2.1-uber.jar!/META-INF/maven/org.apache.maven/maven-core/pom.properties
      ERROR: Processing failed due to a bug in the code. Please report this to hudson-users@googlegroups.com
      java.lang.NullPointerException
      at org.jvnet.hudson.plugins.m2release.M2ReleaseBuildWrapper.getReleaseVersion(M2ReleaseBuildWrapper.java:345)
      at org.jvnet.hudson.plugins.m2release.M2ReleaseBuildWrapper.setUp(M2ReleaseBuildWrapper.java:161)
      at hudson.maven.MavenModuleSetBuild$RunnerImpl.doRun(MavenModuleSetBuild.java:521)
      at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:417)
      at hudson.model.Run.run(Run.java:1362)
      at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:405)
      at hudson.model.ResourceController.execute(ResourceController.java:88)
      at hudson.model.Executor.run(Executor.java:145)
      project=hudson.maven.MavenModuleSet@528e75f2[ften-common-ui_3.0_bugfix]
      project.getModules()=[hudson.maven.MavenModule@63d8f452[ften-common-ui_3.0_bugfix/com.ften.ui:ften-common-ui][ften-common-ui_3.0_bugfix/com.ften.ui:ften-common-ui][relativePath:]]
      project.getRootModule()=null
      FATAL: null

      This error may have been because we switched from one shared repository to a separate repository for each project. Not sure. But that's not why I'm creating this issue.

      What happened is that the maven goals for the project changed from what they were to the maven release goals. - release:clean release:prepare release:perform.

      I suspect that the code to revert the goals to what they were needs to be wrapped in a finally block to ensure that regardless of what happens, the goals are reverted to their original state.

      Ironically, the next build actually did a successful release:clean release:prepare release:perform. edit the successful release was because the goals were changed. I didn't invoke the release plugin.

          [JENKINS-8608] release plugin changes maven goals if an error occurs

          scooper4711 created issue -
          scooper4711 made changes -
          Description Original: We set up a new project and performed a build which succeeded. After that, I scheduled a maven release. it failed with this error:
          Found mavenVersion 2.2.1 from file jar:file:/var/lib/hudson/tools/Maven2/lib/maven-2.2.1-uber.jar!/META-INF/maven/org.apache.maven/maven-core/pom.properties
          ERROR: Processing failed due to a bug in the code. Please report this to hudson-users@googlegroups.com
          java.lang.NullPointerException
          at org.jvnet.hudson.plugins.m2release.M2ReleaseBuildWrapper.getReleaseVersion(M2ReleaseBuildWrapper.java:345)
          at org.jvnet.hudson.plugins.m2release.M2ReleaseBuildWrapper.setUp(M2ReleaseBuildWrapper.java:161)
          at hudson.maven.MavenModuleSetBuild$RunnerImpl.doRun(MavenModuleSetBuild.java:521)
          at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:417)
          at hudson.model.Run.run(Run.java:1362)
          at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:405)
          at hudson.model.ResourceController.execute(ResourceController.java:88)
          at hudson.model.Executor.run(Executor.java:145)
          project=hudson.maven.MavenModuleSet@528e75f2[ften-common-ui_3.0_bugfix]
          project.getModules()=[hudson.maven.MavenModule@63d8f452[ften-common-ui_3.0_bugfix/com.ften.ui:ften-common-ui][ften-common-ui_3.0_bugfix/com.ften.ui:ften-common-ui][relativePath:]]
          project.getRootModule()=null
          FATAL: null

          This error may have been because we switched from one shared repository to a separate repository for each project. Not sure. But that's not why I'm creating this issue.

          What happened is that the maven goals for the project changed from what they were to the maven release goals. - release:clean release:prepare release:perform.

          I suspect that the code to revert the goals to what they were needs to be wrapped in a finally block to ensure that regardless of what happens, the goals are reverted to their original state.

          Ironically, the next build actually did a successful release:clean release:prepare release:perform.
          New: We set up a new project and performed a build which succeeded. After that, I scheduled a maven release. it failed with this error:
          Found mavenVersion 2.2.1 from file jar:file:/var/lib/hudson/tools/Maven2/lib/maven-2.2.1-uber.jar!/META-INF/maven/org.apache.maven/maven-core/pom.properties
          ERROR: Processing failed due to a bug in the code. Please report this to hudson-users@googlegroups.com
          java.lang.NullPointerException
          at org.jvnet.hudson.plugins.m2release.M2ReleaseBuildWrapper.getReleaseVersion(M2ReleaseBuildWrapper.java:345)
          at org.jvnet.hudson.plugins.m2release.M2ReleaseBuildWrapper.setUp(M2ReleaseBuildWrapper.java:161)
          at hudson.maven.MavenModuleSetBuild$RunnerImpl.doRun(MavenModuleSetBuild.java:521)
          at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:417)
          at hudson.model.Run.run(Run.java:1362)
          at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:405)
          at hudson.model.ResourceController.execute(ResourceController.java:88)
          at hudson.model.Executor.run(Executor.java:145)
          project=hudson.maven.MavenModuleSet@528e75f2[ften-common-ui_3.0_bugfix]
          project.getModules()=[hudson.maven.MavenModule@63d8f452[ften-common-ui_3.0_bugfix/com.ften.ui:ften-common-ui][ften-common-ui_3.0_bugfix/com.ften.ui:ften-common-ui][relativePath:]]
          project.getRootModule()=null
          FATAL: null

          This error may have been because we switched from one shared repository to a separate repository for each project. Not sure. But that's not why I'm creating this issue.

          What happened is that the maven goals for the project changed from what they were to the maven release goals. - release:clean release:prepare release:perform.

          I suspect that the code to revert the goals to what they were needs to be wrapped in a finally block to ensure that regardless of what happens, the goals are reverted to their original state.

          Ironically, the next build actually did a successful release:clean release:prepare release:perform. *edit* the successful release was because the goals were changed. I didn't invoke the release plugin.

          Peter Hayes added a comment -

          This relates to the m2release plugin, not the release plugin. I am reassigning it that component.

          Peter Hayes added a comment - This relates to the m2release plugin, not the release plugin. I am reassigning it that component.
          Peter Hayes made changes -
          Component/s New: m2release [ 15621 ]
          Component/s Original: release [ 15622 ]
          Assignee Original: Peter Hayes [ petehayes ] New: James Nord [ teilo ]
          James Nord made changes -
          Link New: This issue duplicates JENKINS-8572 [ JENKINS-8572 ]
          James Nord made changes -
          Resolution New: Duplicate [ 3 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]

          James Nord added a comment -

          subtly different - this is about not resetting on error.
          The other is about it happening at all.

          James Nord added a comment - subtly different - this is about not resetting on error. The other is about it happening at all.
          James Nord made changes -
          Resolution Original: Duplicate [ 3 ]
          Status Original: Resolved [ 5 ] New: Reopened [ 4 ]
          James Nord made changes -
          Link Original: This issue duplicates JENKINS-8572 [ JENKINS-8572 ]

          this is fixed since version 0.9.0

          Dominik Bartholdi added a comment - this is fixed since version 0.9.0

            domi Dominik Bartholdi
            scooper4711 scooper4711
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: