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

NPE at hudson.maven.MavenModuleSet.getMaven(MavenModuleSet.java:982)

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Trivial
    • Resolution: Fixed
    • maven-plugin
    • None
    • Jenkins 1.471, Tomcat 6, RHEL 5.6

    Description

      prerequisite:
      at least one running maven job

      1. open Manage Jenkins - Configure System
      2. click add maven
      3. click delete installer
      4. move the (empty) maven to the top of the list of maven installations
      5. click save
      6. run the maven job

      expected: maven job runs as before

      result:
      ERROR: Processing failed due to a bug in the code. Please report this to jenkinsci-users@googlegroups.com
      java.lang.NullPointerException
      at hudson.maven.MavenModuleSet.getMaven(MavenModuleSet.java:982)
      at hudson.maven.MavenModuleSetBuild.getEnvironment(MavenModuleSetBuild.java:160)
      at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:568)
      at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:499)
      at hudson.model.Run.execute(Run.java:1484)
      at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:477)
      at hudson.model.ResourceController.execute(ResourceController.java:88)
      at hudson.model.Executor.run(Executor.java:236)
      project=hudson.maven.MavenModuleSet@16c8cb41
      [... some list of modules here ... ]

      FATAL: null
      java.lang.NullPointerException
      at hudson.maven.MavenModuleSet.getMaven(MavenModuleSet.java:982)
      at hudson.maven.MavenModuleSetBuild.getEnvironment(MavenModuleSetBuild.java:160)
      at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:568)
      at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:499)
      at hudson.model.Run.execute(Run.java:1484)
      at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:477)
      at hudson.model.ResourceController.execute(ResourceController.java:88)
      at hudson.model.Executor.run(Executor.java:236)

      my hudson.tasks.Maven.xml looks like this:
      <?xml version='1.0' encoding='UTF-8'?>
      <hudson.tasks.Maven_-DescriptorImpl>
      <helpRedirect/>
      <installations>
      <hudson.tasks.Maven_-MavenInstallation>
      <properties>
      <hudson.tools.InstallSourceProperty>
      <installers/>
      </hudson.tools.InstallSourceProperty>
      </properties>
      </hudson.tasks.Maven_-MavenInstallation>
      <hudson.tasks.Maven_-MavenInstallation>
      <name>/cvsroot/maven/maven-bin/maven-2.0.11 (depreciated - for Java 1.4 only)</name>
      <home>/var/hudson/tools/maven-bin/maven-2.0.11</home>
      <properties/>
      </hudson.tasks.Maven_-MavenInstallation>
      <hudson.tasks.Maven_-MavenInstallation>
      <name>/cvsroot/maven/maven-bin/maven-2.2.1 (Java 1.5+ required)</name>
      <home>/var/hudson/tools/maven-bin/maven-2.2.1</home>
      <properties/>
      </hudson.tasks.Maven_-MavenInstallation>
      <hudson.tasks.Maven_-MavenInstallation>
      <name>/cvsroot/maven/maven-bin/maven-3.0.x</name>
      <home>/var/hudson/tools/maven-bin/maven-3.0.x</home>
      <properties/>
      </hudson.tasks.Maven_-MavenInstallation>
      </installations>
      </hudson.tasks.Maven_-DescriptorImpl>

      the fix is simple: just delete the empty maven configuration

      Attachments

        Issue Links

          Activity

            skybird Florian Rosenauer created issue -
            mpapo Michael Pailloncy made changes -
            Field Original Value New Value
            Assignee Pailloncy Michaël [ mpapo ]
            mpapo Michael Pailloncy made changes -
            Status Open [ 1 ] In Progress [ 3 ]

            Done. Waiting for pullrequest acceptance : https://github.com/jenkinsci/jenkins/pull/562

            mpapo Michael Pailloncy added a comment - Done. Waiting for pullrequest acceptance : https://github.com/jenkinsci/jenkins/pull/562

            Code changed in jenkins
            User: Olivier Lamy
            Path:
            changelog.html
            http://jenkins-ci.org/commit/jenkins/d73404d0d59297683b4c159e3d90b785f1de1c85
            Log:
            changelog entry for JENKINS-14510

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Olivier Lamy Path: changelog.html http://jenkins-ci.org/commit/jenkins/d73404d0d59297683b4c159e3d90b785f1de1c85 Log: changelog entry for JENKINS-14510

            Remove all empty Maven installations before saving them

            mpapo Michael Pailloncy added a comment - Remove all empty Maven installations before saving them
            mpapo Michael Pailloncy made changes -
            Fix Version/s current [ 10162 ]
            Resolution Fixed [ 1 ]
            Status In Progress [ 3 ] Resolved [ 5 ]
            lshatzer Larry Shatzer, Jr. made changes -
            Link This issue is related to JENKINS-15293 [ JENKINS-15293 ]

            The fix causes deletion of all configured Maven installations which are set to be installed directly from Apache.

            This happens on adding new Maven installations or just saving the Jenkins settings.

            jeroenferdinandus Jeroen Ferdinandus added a comment - The fix causes deletion of all configured Maven installations which are set to be installed directly from Apache. This happens on adding new Maven installations or just saving the Jenkins settings.
            jeroenferdinandus Jeroen Ferdinandus made changes -
            Resolution Fixed [ 1 ]
            Status Resolved [ 5 ] Reopened [ 4 ]

            Code changed in jenkins
            User: Michael Pailloncy
            Path:
            core/src/main/java/hudson/tasks/Maven.java
            http://jenkins-ci.org/commit/jenkins/e6685a700c2c7e34f6cbd2c9ad474b2c201919f4
            Log:
            do not remove maven installation which does not have a home, like maven installation with automatic installer (bug associated with JENKINS-14510 fix ... sorry..)

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Michael Pailloncy Path: core/src/main/java/hudson/tasks/Maven.java http://jenkins-ci.org/commit/jenkins/e6685a700c2c7e34f6cbd2c9ad474b2c201919f4 Log: do not remove maven installation which does not have a home, like maven installation with automatic installer (bug associated with JENKINS-14510 fix ... sorry..)
            mpapo Michael Pailloncy added a comment - see https://issues.jenkins-ci.org/browse/JENKINS-15293
            mpapo Michael Pailloncy made changes -
            Resolution Fixed [ 1 ]
            Status Reopened [ 4 ] Resolved [ 5 ]
            mpapo Michael Pailloncy made changes -
            Status Resolved [ 5 ] Closed [ 6 ]
            rtyler R. Tyler Croy made changes -
            Workflow JNJira [ 145146 ] JNJira + In-Review [ 206012 ]

            People

              mpapo Michael Pailloncy
              skybird Florian Rosenauer
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: