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

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

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Trivial Trivial
    • maven-plugin
    • None
    • Jenkins 1.471, Tomcat 6, RHEL 5.6

      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

          [JENKINS-14510] NPE at hudson.maven.MavenModuleSet.getMaven(MavenModuleSet.java:982)

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

          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/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

          Michael Pailloncy added a comment - Remove all empty Maven installations before saving them

          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.

          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.

          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/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..)

          Michael Pailloncy added a comment - see https://issues.jenkins-ci.org/browse/JENKINS-15293

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

              Created:
              Updated:
              Resolved: