implemented MAVEN_OPTS support (issue #396)

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@2744 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
kohsuke committed 2007-03-28 06:41:27 +00:00
1 parent 660b955d18
commit 8a3b9ecd71
4 files changed
+31 -1

No files matched your search

@@ -220,7 +220,11 @@ public class MavenBuild extends AbstractBuild<MavenModule,MavenBuild> {
}
}
// UGLY....
/**
* Builds the command line argument list to launch the maven process.
*
* UGLY.
*/
private ArgumentListBuilder buildMavenCmdLine(BuildListener listener) throws IOException, InterruptedException {
MavenInstallation mvn = getParent().getParent().getMaven();
if(mvn==null) {
@@ -251,6 +255,8 @@ public class MavenBuild extends AbstractBuild<MavenModule,MavenBuild> {
if(debugPort!=0)
args.add("-Xrunjdwp:transport=dt_socket,server=y,address="+debugPort);
args.addTokenized(getParent().getParent().getMavenOpts());
args.add("-cp");
args.add(
(isMaster?Which.jarFile(Main.class).getAbsolutePath():slaveRoot.child("maven-agent.jar").getRemote())+
@@ -70,6 +70,11 @@ public final class MavenModuleSet extends AbstractProject<MavenModuleSet,MavenMo
*/
private String mavenName;
/**
* Equivalent of CLI <tt>MAVEN_OPTS</tt>. Can be null.
*/
private String mavenOpts;
public MavenModuleSet(String name) {
super(Hudson.getInstance(),name);
}
@@ -280,6 +285,14 @@ public final class MavenModuleSet extends AbstractProject<MavenModuleSet,MavenMo
return goals;
}
/**
* Possibly null, whitespace-separated (including TAB, NL, etc) VM options
* to be used to launch Maven process.
*/
public String getMavenOpts() {
return mavenOpts;
}
/**
* Gets the Maven to invoke.
* If null, we pick any random Maven installation.
@@ -326,6 +339,7 @@ public final class MavenModuleSet extends AbstractProject<MavenModuleSet,MavenMo
if(rootPOM.equals("pom.xml")) rootPOM=null; // normalization
goals = Util.fixEmpty(req.getParameter("goals").trim());
mavenOpts = Util.fixEmpty(req.getParameter("mavenOpts").trim());
mavenName = req.getParameter("maven_version");
}