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

m2release fails if no existing build exists for the job

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Critical Critical
    • m2release-plugin
    • None

      I installed m2release plugin into Hudson and got the below error information after start to perform maven release.

      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:516)
      at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:417)
      at hudson.model.Run.run(Run.java:1362)
      at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:400)
      at hudson.model.ResourceController.execute(ResourceController.java:88)
      at hudson.model.Executor.run(Executor.java:145)
      project=hudson.maven.MavenModuleSet@3fcf59[Test]
      project.getModules()=[]
      project.getRootModule()=null
      FATAL: null
      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:516)
      at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:417)
      at hudson.model.Run.run(Run.java:1362)
      at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:400)
      at hudson.model.ResourceController.execute(ResourceController.java:88)
      at hudson.model.Executor.run(Executor.java:145)

          [JENKINS-8664] m2release fails if no existing build exists for the job

          James Nord added a comment -

          Have you previously performed a build or is this the first build of a project?

          James Nord added a comment - Have you previously performed a build or is this the first build of a project?

          micha4311 added a comment - - edited

          We also have this problem after upgrading from Hudson 1.377 to Jenkins 1.397 with an existing job where releases made no problems.

          If you specify the versions everything is ok

          Edit: we are using m2release-Plugin 0.6.1 (and did use the same before in 1.377). So it seems that this depends on a change in jenkins since 1.377

          micha4311 added a comment - - edited We also have this problem after upgrading from Hudson 1.377 to Jenkins 1.397 with an existing job where releases made no problems. If you specify the versions everything is ok Edit: we are using m2release-Plugin 0.6.1 (and did use the same before in 1.377). So it seems that this depends on a change in jenkins since 1.377

          micha4311 added a comment -

          Changed to critical as it makes the new jenkins unusable at our site (and I suspect this also be the case in other installations)

          micha4311 added a comment - Changed to critical as it makes the new jenkins unusable at our site (and I suspect this also be the case in other installations)

          James Nord added a comment -

          Do you use Maven 2.x or Maven 3.x for the job?

          James Nord added a comment - Do you use Maven 2.x or Maven 3.x for the job?

          micha4311 added a comment -

          It's a maven 2.2.1 job

          micha4311 added a comment - It's a maven 2.2.1 job

          micha4311 added a comment -

          Some further investigation I made:

          In one of the current cases there was no successful build since the last release as the maven goals were set to the release-goals (and the build failed because of already existing tag). I corrected the goals and tried a release (this is test package for the infrastructure)

          micha4311 added a comment - Some further investigation I made: In one of the current cases there was no successful build since the last release as the maven goals were set to the release-goals (and the build failed because of already existing tag). I corrected the goals and tried a release (this is test package for the infrastructure)

          petrjanata added a comment -

          NullPointer happens when the modules have not been parsed yet.
          In my case:
          1. setup new job
          2. run Perform Maven Release; build failed with above exception
          (I checked modules view and there were no modules. Also when setting release and new development versions during release process, there are no modules visible with option 'Specify version(s)'.)
          4. run normal build, even validate phase is sufficient
          Log contains:
          Parsing POMs
          Discovered a new module xxx ...
          5. now the release works correctly

          petrjanata added a comment - NullPointer happens when the modules have not been parsed yet. In my case: 1. setup new job 2. run Perform Maven Release; build failed with above exception (I checked modules view and there were no modules. Also when setting release and new development versions during release process, there are no modules visible with option 'Specify version(s)'.) 4. run normal build, even validate phase is sufficient Log contains: Parsing POMs Discovered a new module xxx ... 5. now the release works correctly

          Code changed in jenkins
          User: imod
          Path:
          src/main/java/org/jvnet/hudson/plugins/m2release/M2ReleaseAction.java
          src/main/resources/org/jvnet/hudson/plugins/m2release/M2ReleaseAction/index.jelly
          http://jenkins-ci.org/commit/m2release-plugin/a8ae1cd2719e713e7c0d1678add7602fda7dd0f7
          Log:
          fix JENKINS-8664 - m2release fails if no existing build exists for the job

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: imod Path: src/main/java/org/jvnet/hudson/plugins/m2release/M2ReleaseAction.java src/main/resources/org/jvnet/hudson/plugins/m2release/M2ReleaseAction/index.jelly http://jenkins-ci.org/commit/m2release-plugin/a8ae1cd2719e713e7c0d1678add7602fda7dd0f7 Log: fix JENKINS-8664 - m2release fails if no existing build exists for the job

          solved since version 0.9.0

          Dominik Bartholdi added a comment - solved since version 0.9.0

            domi Dominik Bartholdi
            stevenzhu Steven Zhu
            Votes:
            5 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: