mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-16 05:22:22 +00:00
[FIXED JENKINS-8865] Environment variable not available for Maven build/POM parsing.
This commit is contained in:
1 parent
f9f030db8f
commit
a5d9528c8f
1 file changed
+11
-2
@@ -54,6 +54,7 @@ import hudson.model.TaskListener;
|
||||
import hudson.remoting.Channel;
|
||||
import hudson.remoting.VirtualChannel;
|
||||
import hudson.scm.ChangeLogSet;
|
||||
import hudson.slaves.NodeProperty;
|
||||
import hudson.tasks.BuildWrapper;
|
||||
import hudson.tasks.MailSender;
|
||||
import hudson.tasks.Maven.MavenInstallation;
|
||||
@@ -725,7 +726,7 @@ public class MavenModuleSetBuild extends AbstractMavenBuild<MavenModuleSet,Maven
|
||||
|
||||
List<PomInfo> poms;
|
||||
try {
|
||||
poms = getModuleRoot().act(new PomParser(listener, mvn, project, mavenVersion));
|
||||
poms = getModuleRoot().act(new PomParser(listener, mvn, project, mavenVersion, envVars));
|
||||
} catch (IOException e) {
|
||||
if (e.getCause() instanceof AbortException)
|
||||
throw (AbortException) e.getCause();
|
||||
@@ -1046,7 +1047,7 @@ public class MavenModuleSetBuild extends AbstractMavenBuild<MavenModuleSet,Maven
|
||||
|
||||
String rootPOMRelPrefix;
|
||||
|
||||
public PomParser(BuildListener listener, MavenInstallation mavenHome, MavenModuleSet project,String mavenVersion) {
|
||||
public PomParser(BuildListener listener, MavenInstallation mavenHome, MavenModuleSet project,String mavenVersion,EnvVars envVars) {
|
||||
// project cannot be shipped to the remote JVM, so all the relevant properties need to be captured now.
|
||||
this.listener = listener;
|
||||
this.mavenHome = mavenHome;
|
||||
@@ -1062,6 +1063,14 @@ public class MavenModuleSetBuild extends AbstractMavenBuild<MavenModuleSet,Maven
|
||||
}
|
||||
}
|
||||
}
|
||||
if (envVars != null && !envVars.isEmpty()) {
|
||||
for (Entry<String,String> entry : envVars.entrySet()) {
|
||||
if (entry.getKey() != null && entry.getValue() != null) {
|
||||
this.properties.put( "env." + entry.getKey(), entry.getValue() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.nonRecursive = project.isNonRecursive();
|
||||
this.workspaceProper = project.getLastBuild().getWorkspace().getRemote();
|
||||
if (project.usesPrivateRepository()) {
|
||||
|
||||
Reference in new issue
Block a user