mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-16 05:22:22 +00:00
[FIXED HUDSON-2932] Maven projects now properly fall back through project-defined MAVEN_OPTS to globally-defined MAVEN_OPTS to executor environment variable MAVEN_OPTS - also added globally-defined MAVEN_OPTS and related changes
git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@24652 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
1 parent
9b19525e06
commit
c809404615
8 files changed
+193
-3
No files matched your search
@@ -615,9 +615,23 @@ public final class MavenModuleSet extends AbstractMavenProject<MavenModuleSet,Ma
|
||||
/**
|
||||
* Possibly null, whitespace-separated (including TAB, NL, etc) VM options
|
||||
* to be used to launch Maven process.
|
||||
*
|
||||
* If mavenOpts is null or empty, we'll return the globally-defined MAVEN_OPTS.
|
||||
*/
|
||||
public String getMavenOpts() {
|
||||
return mavenOpts;
|
||||
if ((mavenOpts!=null) && (mavenOpts.trim().length()>0)) {
|
||||
return mavenOpts;
|
||||
}
|
||||
else {
|
||||
return DESCRIPTOR.getGlobalMavenOpts();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set mavenOpts.
|
||||
*/
|
||||
public void setMavenOpts(String mavenOpts) {
|
||||
this.mavenOpts = mavenOpts;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -753,6 +767,20 @@ public final class MavenModuleSet extends AbstractMavenProject<MavenModuleSet,Ma
|
||||
public static final DescriptorImpl DESCRIPTOR = new DescriptorImpl();
|
||||
|
||||
public static final class DescriptorImpl extends AbstractProjectDescriptor {
|
||||
/**
|
||||
* Globally-defined MAVEN_OPTS.
|
||||
*/
|
||||
private String globalMavenOpts;
|
||||
|
||||
public String getGlobalMavenOpts() {
|
||||
return globalMavenOpts;
|
||||
}
|
||||
|
||||
public void setGlobalMavenOpts(String globalMavenOpts) {
|
||||
this.globalMavenOpts = globalMavenOpts;
|
||||
save();
|
||||
}
|
||||
|
||||
public String getDisplayName() {
|
||||
return Messages.MavenModuleSet_DiplayName();
|
||||
}
|
||||
@@ -765,6 +793,14 @@ public final class MavenModuleSet extends AbstractMavenProject<MavenModuleSet,Ma
|
||||
return Hudson.getInstance().getDescriptorByType(Maven.DescriptorImpl.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean configure( StaplerRequest req, JSONObject o ) {
|
||||
globalMavenOpts = Util.fixEmptyAndTrim(o.getString("globalMavenOpts"));
|
||||
save();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isApplicable(Descriptor descriptor) {
|
||||
return !NOT_APPLICABLE_TYPES.contains(descriptor.clazz);
|
||||
|
||||
Reference in new issue
Block a user