Skip to content
Permalink
Browse files

[FIXED JENKINS-7702] Tomcat sometimes defines a $JAVA_OPTS inappropri…

…ate for subprocesses.
  • Loading branch information...
jglick committed Feb 22, 2013
1 parent 886eddc commit 47586fa88e3c0886ceaae78d8703e15b8f5fd2f0
Showing with 10 additions and 0 deletions.
  1. +10 −0 src/main/java/com/g2one/hudson/grails/GrailsBuilder.java
@@ -31,6 +31,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;
@@ -208,6 +211,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 47586fa

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