Skip to content
Permalink
Browse files

Merge pull request #5 from jglick/JENKINS-7702

[FIXED JENKINS-7702] Tomcat sometimes defines a $JAVA_OPTS inappropriate for subprocesses.
  • Loading branch information...
kiy0taka committed Apr 19, 2013
2 parents 46a7853 + 47586fa commit 3393e20cedea00162367804a8d3d2f579b602362
Showing with 10 additions and 0 deletions.
  1. +10 −0 src/main/java/com/g2one/hudson/grails/GrailsBuilder.java
@@ -30,6 +30,9 @@

public class GrailsBuilder extends Builder {

private static final String JAVA_OPTS = "JAVA_OPTS";
private static final String JENKINS_7702_TRIGGER = "-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager";

private final String targets;
private final String name;
private String grailsWorkDir;
@@ -207,6 +210,13 @@ public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListen
.forNode(Computer.currentComputer().getNode(), listener);
env.put("GRAILS_HOME", grailsInstallation.getHome());
}

String jopts = env.get(JAVA_OPTS);
if (jopts != null && jopts.contains(JENKINS_7702_TRIGGER)) {
listener.getLogger().println("[JENKINS-7702] sanitizing $" + JAVA_OPTS);
env.put(JAVA_OPTS, jopts.replace(JENKINS_7702_TRIGGER, "")); // leading/trailing spaces should be harmless
}

for (String[] targetsAndArgs : targetsToRun) {

String target = targetsAndArgs[0];

0 comments on commit 3393e20

Please sign in to comment.
You can’t perform that action at this time.