提交 c50a7cc6 编写于 作者: O Olivier Lamy

use new maven3 interceptor commons jar

上级 565586f8
...@@ -119,6 +119,11 @@ THE SOFTWARE. ...@@ -119,6 +119,11 @@ THE SOFTWARE.
<artifactId>maven3-interceptor</artifactId> <artifactId>maven3-interceptor</artifactId>
<version>${mavenInterceptorsVersion}</version> <version>${mavenInterceptorsVersion}</version>
</dependency> </dependency>
<dependency>
<groupId>org.jenkins-ci.main.maven</groupId>
<artifactId>maven3-interceptor-commons</artifactId>
<version>${mavenInterceptorsVersion}</version>
</dependency>
<dependency> <dependency>
<groupId>org.apache.ant</groupId> <groupId>org.apache.ant</groupId>
<artifactId>ant</artifactId> <artifactId>ant</artifactId>
......
...@@ -324,6 +324,12 @@ public abstract class AbstractMavenProcessFactory ...@@ -324,6 +324,12 @@ public abstract class AbstractMavenProcessFactory
// interceptor.jar // interceptor.jar
args.add(getMavenInterceptorClassPath(mvn,isMaster,slaveRoot)); args.add(getMavenInterceptorClassPath(mvn,isMaster,slaveRoot));
String mavenInterceptorCommonClasspath = getMavenInterceptorCommonClassPath( mvn, isMaster, slaveRoot );
if (mavenInterceptorCommonClasspath!=null){
args.add( mavenInterceptorCommonClasspath );
}
// TCP/IP port to establish the remoting infrastructure // TCP/IP port to establish the remoting infrastructure
args.add(tcpPort); args.add(tcpPort);
...@@ -344,6 +350,14 @@ public abstract class AbstractMavenProcessFactory ...@@ -344,6 +350,14 @@ public abstract class AbstractMavenProcessFactory
* Returns the classpath string for the maven-interceptor jar * Returns the classpath string for the maven-interceptor jar
*/ */
protected abstract String getMavenInterceptorClassPath(MavenInstallation mvn,boolean isMaster,FilePath slaveRoot) throws IOException, InterruptedException; protected abstract String getMavenInterceptorClassPath(MavenInstallation mvn,boolean isMaster,FilePath slaveRoot) throws IOException, InterruptedException;
/**
* Returns the classpath string for the maven-interceptor jar
* @since 1.525
*/
protected String getMavenInterceptorCommonClassPath(MavenInstallation mvn,boolean isMaster,FilePath slaveRoot) throws IOException, InterruptedException {
return null;
}
/** /**
* For Maven 2.1.x - 2.2.x we need an additional jar which overrides some classes in the other interceptor jar. * For Maven 2.1.x - 2.2.x we need an additional jar which overrides some classes in the other interceptor jar.
......
...@@ -41,6 +41,7 @@ import java.net.URL; ...@@ -41,6 +41,7 @@ import java.net.URL;
import org.jvnet.hudson.maven3.agent.Maven3Main; import org.jvnet.hudson.maven3.agent.Maven3Main;
import org.jvnet.hudson.maven3.launcher.Maven3Launcher; import org.jvnet.hudson.maven3.launcher.Maven3Launcher;
import org.jvnet.hudson.maven3.listeners.HudsonMavenExecutionResult;
/** /**
* {@link AbstractMavenProcessFactory} for Maven 3. * {@link AbstractMavenProcessFactory} for Maven 3.
...@@ -74,6 +75,12 @@ public class Maven3ProcessFactory extends AbstractMavenProcessFactory implements ...@@ -74,6 +75,12 @@ public class Maven3ProcessFactory extends AbstractMavenProcessFactory implements
slaveRoot.child("maven3-interceptor.jar").getRemote(); slaveRoot.child("maven3-interceptor.jar").getRemote();
} }
protected String getMavenInterceptorCommonClassPath(MavenInstallation mvn,boolean isMaster,FilePath slaveRoot) throws IOException, InterruptedException {
return isMaster?
Which.jarFile(HudsonMavenExecutionResult.class).getAbsolutePath():
slaveRoot.child("maven3-interceptor-commons.jar").getRemote();
}
@Override @Override
protected String getMavenInterceptorOverride(MavenInstallation mvn, protected String getMavenInterceptorOverride(MavenInstallation mvn,
boolean isMaster, FilePath slaveRoot) throws IOException, boolean isMaster, FilePath slaveRoot) throws IOException,
......
...@@ -43,6 +43,7 @@ import org.apache.tools.ant.taskdefs.Zip; ...@@ -43,6 +43,7 @@ import org.apache.tools.ant.taskdefs.Zip;
import org.codehaus.plexus.classworlds.ClassWorld; import org.codehaus.plexus.classworlds.ClassWorld;
import org.jvnet.hudson.maven3.agent.Maven3Main; import org.jvnet.hudson.maven3.agent.Maven3Main;
import org.jvnet.hudson.maven3.launcher.Maven3Launcher; import org.jvnet.hudson.maven3.launcher.Maven3Launcher;
import org.jvnet.hudson.maven3.listeners.HudsonMavenExecutionResult;
/** /**
* When a slave is connected, copy <tt>maven-agent.jar</tt> and <tt>maven-intercepter.jar</tt> * When a slave is connected, copy <tt>maven-agent.jar</tt> and <tt>maven-intercepter.jar</tt>
...@@ -58,6 +59,7 @@ public class MavenComputerListener extends ComputerListener { ...@@ -58,6 +59,7 @@ public class MavenComputerListener extends ComputerListener {
copyJar(logger, root, Maven3Main.class, "maven3-agent"); copyJar(logger, root, Maven3Main.class, "maven3-agent");
copyJar(logger, root, Maven3Launcher.class, "maven3-interceptor"); copyJar(logger, root, Maven3Launcher.class, "maven3-interceptor");
copyJar(logger, root, AbortException.class, "maven-interceptor"); copyJar(logger, root, AbortException.class, "maven-interceptor");
copyJar(logger, root, HudsonMavenExecutionResult.class, "maven3-interceptor-commons" );
copyJar(logger, root, Maven21Interceptor.class, "maven2.1-interceptor"); copyJar(logger, root, Maven21Interceptor.class, "maven2.1-interceptor");
copyJar(logger, root, ClassWorld.class, "plexus-classworld"); copyJar(logger, root, ClassWorld.class, "plexus-classworld");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册