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

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

XMLWordPrintable

    • 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

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

              Created:
              Updated:
              Resolved: