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

NPE during polling when Maven home defined only on slaves

      A user in a cloud setup in which there was one Maven installation defined, with no static installation directory but a plugin offering a location for cloud slaves, ran Subversion polling on a job and got this error:

      java.lang.IllegalArgumentException: Null value not allowed as an environment variable: M2_HOME 
      	at hudson.EnvVars.put(EnvVars.java:172) 
      	at hudson.tasks.Maven$MavenInstallation.buildEnvVars(Maven.java:489) 
      	at hudson.maven.MavenModuleSetBuild.getEnvironment(MavenModuleSetBuild.java:172) 
      	at hudson.scm.SubversionSCM.compareRemoteRevisionWith(SubversionSCM.java:1230) 
      	at hudson.scm.SCM._compareRemoteRevisionWith(SCM.java:356) 
      	at hudson.scm.SCM.poll(SCM.java:373) 
      	at hudson.model.AbstractProject._poll(AbstractProject.java:1521) 
      	at hudson.model.AbstractProject.poll(AbstractProject.java:1446) 
      	at hudson.triggers.SCMTrigger$Runner.runPolling(SCMTrigger.java:439) 
      	at hudson.triggers.SCMTrigger$Runner.run(SCMTrigger.java:468) 
      	at hudson.util.SequentialExecutionQueue$QueueEntry.run(SequentialExecutionQueue.java:118) 
      	at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) 
      	at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) 
      	at java.util.concurrent.FutureTask.run(Unknown Source) 
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) 
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) 
      	at java.lang.Thread.run(Unknown Source)
      

          [JENKINS-18898] NPE during polling when Maven home defined only on slaves

          Code changed in jenkins
          User: Jesse Glick
          Path:
          changelog.html
          core/src/main/java/hudson/model/JDK.java
          core/src/main/java/hudson/tasks/Maven.java
          core/src/main/java/hudson/tools/ToolInstallation.java
          test/src/test/java/hudson/tasks/MavenTest.java
          http://jenkins-ci.org/commit/jenkins/be158b4b2ae269de4a55d04f293c1ec34765e056
          Log:
          [FIXED JENKINS-18898] ToolInstallation.getHome may be null, and buildEnvVars must take that into account.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: changelog.html core/src/main/java/hudson/model/JDK.java core/src/main/java/hudson/tasks/Maven.java core/src/main/java/hudson/tools/ToolInstallation.java test/src/test/java/hudson/tasks/MavenTest.java http://jenkins-ci.org/commit/jenkins/be158b4b2ae269de4a55d04f293c1ec34765e056 Log: [FIXED JENKINS-18898] ToolInstallation.getHome may be null, and buildEnvVars must take that into account.

          Code changed in jenkins
          User: Jesse Glick
          Path:
          maven-plugin/src/main/java/hudson/maven/MavenModuleSetBuild.java
          http://jenkins-ci.org/commit/jenkins/33101a3a01d3ec716a8c81eee97bbccde0c3793e
          Log:
          JENKINS-18898 Comment.
          Unclear what Run.getEnvironment is supposed to return after the build is complete.
          In particular, SubversionSCM calls this during polling to substitute variables in e.g. repo URL.
          Presumably in such a case node-specific variables such as ToolInstallation.home would be irrelevant.
          But in general should this reflect the “current” computer (if any), or the computer on which the build ran?

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: maven-plugin/src/main/java/hudson/maven/MavenModuleSetBuild.java http://jenkins-ci.org/commit/jenkins/33101a3a01d3ec716a8c81eee97bbccde0c3793e Log: JENKINS-18898 Comment. Unclear what Run.getEnvironment is supposed to return after the build is complete. In particular, SubversionSCM calls this during polling to substitute variables in e.g. repo URL. Presumably in such a case node-specific variables such as ToolInstallation.home would be irrelevant. But in general should this reflect the “current” computer (if any), or the computer on which the build ran?

          dogfood added a comment -

          Integrated in jenkins_main_trunk #2744
          [FIXED JENKINS-18898] ToolInstallation.getHome may be null, and buildEnvVars must take that into account. (Revision be158b4b2ae269de4a55d04f293c1ec34765e056)
          JENKINS-18898 Comment. (Revision 33101a3a01d3ec716a8c81eee97bbccde0c3793e)

          Result = SUCCESS
          Jesse Glick : be158b4b2ae269de4a55d04f293c1ec34765e056
          Files :

          • core/src/main/java/hudson/model/JDK.java
          • core/src/main/java/hudson/tools/ToolInstallation.java
          • changelog.html
          • test/src/test/java/hudson/tasks/MavenTest.java
          • core/src/main/java/hudson/tasks/Maven.java

          Jesse Glick : 33101a3a01d3ec716a8c81eee97bbccde0c3793e
          Files :

          • maven-plugin/src/main/java/hudson/maven/MavenModuleSetBuild.java

          dogfood added a comment - Integrated in jenkins_main_trunk #2744 [FIXED JENKINS-18898] ToolInstallation.getHome may be null, and buildEnvVars must take that into account. (Revision be158b4b2ae269de4a55d04f293c1ec34765e056) JENKINS-18898 Comment. (Revision 33101a3a01d3ec716a8c81eee97bbccde0c3793e) Result = SUCCESS Jesse Glick : be158b4b2ae269de4a55d04f293c1ec34765e056 Files : core/src/main/java/hudson/model/JDK.java core/src/main/java/hudson/tools/ToolInstallation.java changelog.html test/src/test/java/hudson/tasks/MavenTest.java core/src/main/java/hudson/tasks/Maven.java Jesse Glick : 33101a3a01d3ec716a8c81eee97bbccde0c3793e Files : maven-plugin/src/main/java/hudson/maven/MavenModuleSetBuild.java

          Code changed in jenkins
          User: Jesse Glick
          Path:
          src/main/java/hudson/maven/MavenModuleSetBuild.java
          http://jenkins-ci.org/commit/maven-plugin/f8b28d60df5ef94c0185381d0879b40eb05eb64b
          Log:
          JENKINS-18898 Comment.
          Unclear what Run.getEnvironment is supposed to return after the build is complete.
          In particular, SubversionSCM calls this during polling to substitute variables in e.g. repo URL.
          Presumably in such a case node-specific variables such as ToolInstallation.home would be irrelevant.
          But in general should this reflect the “current” computer (if any), or the computer on which the build ran?
          Originally-Committed-As: 33101a3a01d3ec716a8c81eee97bbccde0c3793e

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: src/main/java/hudson/maven/MavenModuleSetBuild.java http://jenkins-ci.org/commit/maven-plugin/f8b28d60df5ef94c0185381d0879b40eb05eb64b Log: JENKINS-18898 Comment. Unclear what Run.getEnvironment is supposed to return after the build is complete. In particular, SubversionSCM calls this during polling to substitute variables in e.g. repo URL. Presumably in such a case node-specific variables such as ToolInstallation.home would be irrelevant. But in general should this reflect the “current” computer (if any), or the computer on which the build ran? Originally-Committed-As: 33101a3a01d3ec716a8c81eee97bbccde0c3793e

            jglick Jesse Glick
            jglick Jesse Glick
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: