mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-16 05:22:22 +00:00
Expose MAVEN_OPTS as env. var, in addition to set it to Maven JVM.
(<a href="https://hudson.dev.java.net/issues/show_bug.cgi?id=3644">issue 3644</a>) git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@19452 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
1 parent
f6e9363491
commit
3ec951ec1a
3 files changed
+31
-1
No files matched your search
@@ -42,6 +42,7 @@ import hudson.model.Hudson;
|
||||
import hudson.model.ParametersAction;
|
||||
import hudson.model.Result;
|
||||
import hudson.model.Computer;
|
||||
import hudson.model.TaskListener;
|
||||
import hudson.model.Cause.UpstreamCause;
|
||||
import hudson.remoting.Channel;
|
||||
import hudson.remoting.VirtualChannel;
|
||||
@@ -111,6 +112,21 @@ public final class MavenModuleSetBuild extends AbstractBuild<MavenModuleSet,Mave
|
||||
super(project, buildDir);
|
||||
}
|
||||
|
||||
/**
|
||||
* Exposes {@code MAVEN_OPTS} to forked processes.
|
||||
*
|
||||
* When we fork Maven, we do so directly by executing Java, thus this environment variable
|
||||
* is pointless (we have to tweak JVM launch option correctly instead, which can be seen in
|
||||
* {@link MavenProcessFactory}), but setting the environment variable explicitly is still
|
||||
* useful in case this Maven forks other Maven processes via normal way. See HUDSON-3644.
|
||||
*/
|
||||
@Override
|
||||
public EnvVars getEnvironment(TaskListener log) throws IOException, InterruptedException {
|
||||
EnvVars envs = super.getEnvironment(log);
|
||||
envs.put("MAVEN_OPTS",project.getMavenOpts());
|
||||
return envs;
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays the combined status of all modules.
|
||||
* <p>
|
||||
|
||||
Reference in new issue
Block a user