fixed a bug where the native m2 support doesn't work on slaves.

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@2367 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
kohsuke committed 2007-03-07 02:06:51 +00:00
1 parent 2fdb312b79
commit b237dbdbe4
1 file changed
+10 -4
@@ -173,12 +173,18 @@ public class MavenBuild extends AbstractBuild<MavenModule,MavenBuild> {
}
}
private static final class getJavaExe implements Callable<String,IOException> {
private static final class GetJavaExe implements Callable<String,IOException> {
public String call() throws IOException {
return new File(new File(System.getProperty("java.home")),"bin/java").getPath();
}
}
private static final class GetRemotingJar implements Callable<String,IOException> {
public String call() throws IOException {
return Which.jarFile(Launcher.class).getPath();
}
}
private class RunnerImpl extends AbstractRunner {
protected Result doRun(BuildListener listener) throws Exception {
// pick up a list of reporters to run
@@ -239,7 +245,7 @@ public class MavenBuild extends AbstractBuild<MavenModule,MavenBuild> {
slaveRoot = ((Slave)getCurrentNode()).getFilePath();
ArgumentListBuilder args = new ArgumentListBuilder();
args.add(launcher.getChannel().call(new getJavaExe()));
args.add(launcher.getChannel().call(new GetJavaExe()));
//args.add("-Xrunjdwp:transport=dt_socket,server=y,address=8002");
@@ -253,8 +259,8 @@ public class MavenBuild extends AbstractBuild<MavenModule,MavenBuild> {
// M2_HOME
args.add(mvn.getMavenHome());
// remoting.jar
args.add(Which.jarFile(Launcher.class).getPath());
// remoting.jar // TODO: locate it on remote node
args.add(launcher.getChannel().call(new GetRemotingJar()));
// interceptor.jar
args.add(isMaster?
Which.jarFile(hudson.maven.agent.PluginManagerInterceptor.class).getAbsolutePath():