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

          Jesse Glick created issue -

          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.
          SCM/JIRA link daemon made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]

          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
          kutzi made changes -
          Link New: This issue is duplicated by JENKINS-18621 [ JENKINS-18621 ]
          Daniel Beck made changes -
          Labels Original: exception slave tools New: exception lts-candidate slave tools

          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
          Oliver Gondža made changes -
          Labels Original: exception lts-candidate slave tools New: 1.509.4-rejected exception slave tools
          R. Tyler Croy made changes -
          Workflow Original: JNJira [ 150345 ] New: JNJira + In-Review [ 193479 ]

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

              Created:
              Updated:
              Resolved: