Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
[FIXED JENKINS-18235] set PATH with GRAILS_HOME/bin
- Loading branch information
Showing
with
6 additions
and
2 deletions.
-
+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()); |
|
|