Skip to content
Permalink
Browse files

[FIXED JENKINS-18235] set PATH with GRAILS_HOME/bin

  • Loading branch information...
ndeloof committed Jun 6, 2013
1 parent b64d732 commit 250c5343d2ab489e7d799a83d644d295b38803d6
Showing with 6 additions and 2 deletions.
  1. +6 −2 src/main/java/com/g2one/hudson/grails/GrailsBuilder.java
@@ -15,6 +15,7 @@
import org.kohsuke.stapler.DataBoundConstructor;
import org.kohsuke.stapler.StaplerRequest;

import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
@@ -203,6 +204,10 @@ public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListen
grailsInstallation = grailsInstallation.forEnvironment(env)
.forNode(Computer.currentComputer().getNode(), listener);
env.put("GRAILS_HOME", grailsInstallation.getHome());

String path = env.get("PATH");
path = path == null ? "" : path + (launcher.isUnix() ? ":" : ";");
env.put("PATH", path + grailsInstallation.getHome() + (launcher.isUnix() ? "/bin" : "\\bin"));
}

String jopts = env.get(JAVA_OPTS);
@@ -252,8 +257,7 @@ public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListen
addArgument("--refresh-dependencies", refreshDependencies, args, env, targetsAndArgs);

if (!launcher.isUnix()) {
args.prepend("cmd.exe", "/C");
args.add("&&", "exit", "%%ERRORLEVEL%%");
args = args.toWindowsCommand();
}

GrailsConsoleAnnotator gca = new GrailsConsoleAnnotator(listener.getLogger(), build.getCharset());

0 comments on commit 250c534

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