@@ -0,0 +1,3465 @@
+/*%0A * The MIT License%0A * %0A * Copyright (c) 2004-2009, Sun Microsystems, Inc., Kohsuke Kawaguchi, Olivier Lamy%0A * %0A * Permission is hereby granted, free of charge, to any person obtaining a copy%0A * of this software and associated documentation files (the %22Software%22), to deal%0A * in the Software without restriction, including without limitation the rights%0A * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell%0A * copies of the Software, and to permit persons to whom the Software is%0A * furnished to do so, subject to the following conditions:%0A * %0A * The above copyright notice and this permission notice shall be included in%0A * all copies or substantial portions of the Software.%0A * %0A * THE SOFTWARE IS PROVIDED %22AS IS%22, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR%0A * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,%0A * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE%0A * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER%0A * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,%0A * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN%0A * THE SOFTWARE.%0A */%0Apackage hudson.maven;%0A%0Aimport hudson.EnvVars;%0Aimport hudson.FilePath;%0Aimport hudson.Launcher;%0Aimport hudson.model.BuildListener;%0Aimport hudson.model.Run.RunnerAbortedException;%0Aimport hudson.model.TaskListener;%0Aimport hudson.remoting.Callable;%0Aimport hudson.remoting.Channel;%0Aimport hudson.remoting.Which;%0Aimport hudson.tasks.Maven.MavenInstallation;%0Aimport org.jvnet.hudson.maven3.agent.Maven3Main;%0Aimport org.jvnet.hudson.maven3.launcher.Maven3Launcher;%0Aimport org.jvnet.hudson.maven3.listeners.HudsonMavenExecutionResult;%0A%0Aimport java.io.File;%0Aimport java.io.FilenameFilter;%0Aimport java.io.IOException;%0Aimport java.net.URL;%0A%0A/**%0A * %7B@link hudson.maven.AbstractMavenProcessFactory%7D for Maven 3.%0A *%0A * @author Olivier Lamy%0A */%0Apublic class Maven31ProcessFactory%0A    extends Maven3ProcessFactory%0A%7B%0A%0A    Maven31ProcessFactory( MavenModuleSet mms, AbstractMavenBuild%3C?, ?%3E build, Launcher launcher, EnvVars envVars,%0A                           String mavenOpts, FilePath workDir ) %7B%0A        super( mms, build, launcher, envVars, mavenOpts, workDir );%0A    %7D%0A%0A    @Override%0A    protected String getMavenAgentClassPath(MavenInstallation mvn,boolean isMaster,FilePath slaveRoot,BuildListener listener) throws IOException, InterruptedException %7B%0A        String classWorldsJar = getLauncher().getChannel().call(new Maven3ProcessFactory.GetClassWorldsJar(mvn.getHome(),listener));%0A        %0A        return (isMaster? Which.jarFile(Maven3Main.class).getAbsolutePath():slaveRoot.child(%22maven31-agent.jar%22).getRemote())+%0A            (getLauncher().isUnix()?%22:%22:%22;%22)+classWorldsJar;%0A    %7D%0A    %0A%0A    %0A    @Override%0A    protected String getMavenInterceptorClassPath(MavenInstallation mvn,boolean isMaster,FilePath slaveRoot) throws IOException, InterruptedException %7B%0A        return isMaster?%0A                Which.jarFile(Maven3Launcher.class).getAbsolutePath():%0A                slaveRoot.child(%22maven31-interceptor.jar%22).getRemote();%0A    %7D%0A%0A    protected String getMavenInterceptorCommonClassPath(MavenInstallation mvn,boolean isMaster,FilePath slaveRoot) throws IOException, InterruptedException %7B%0A        return isMaster?%0A            Which.jarFile(HudsonMavenExecutionResult.class).getAbsolutePath():%0A            slaveRoot.child(%22maven3-interceptor-commons.jar%22).getRemote();%0A    %7D%0A%0A%0A%7D%0A

add new MavenProcessFactory for 3.1