mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-17 14:02:22 +00:00
Issue number:
Obtained from: Submitted by: Reviewed by: git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@3339 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
1 parent
6cd3086989
commit
71de79e257
1 file changed
+10
-1
@@ -141,8 +141,17 @@ public class Maven extends Builder {
|
||||
}
|
||||
|
||||
Map<String,String> env = build.getEnvVars();
|
||||
if(ai!=null)
|
||||
if(ai!=null) {
|
||||
// if somebody has use M2_HOME they will get a classloading error
|
||||
// when M2_HOME points to a different version of Maven2 from
|
||||
// MAVEN_HOME (as Maven 2 gives M2_HOME priority)
|
||||
//
|
||||
// The other solution would be to set M2_HOME if we are calling Maven2
|
||||
// and MAVEN_HOME for Maven1 (only of use for strange people that
|
||||
// are calling Maven2 from Maven1)
|
||||
env.remove("M2_HOME");
|
||||
env.put("MAVEN_HOME",ai.getMavenHome());
|
||||
}
|
||||
// just as a precaution
|
||||
// see http://maven.apache.org/continuum/faqs.html#how-does-continuum-detect-a-successful-build
|
||||
env.put("MAVEN_TERMINATE_CMD","on");
|
||||
|
||||
Reference in new issue
Block a user