1 package hudson.maven.agent; 2 3 import hudson.remoting.Callable; 4 import org.apache.maven.project.MavenProject; 5 import org.apache.maven.plugin.MojoExecution; 6 import org.codehaus.plexus.configuration.PlexusConfiguration; 7 import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluator; 8 9 import java.io.IOException ; 10 11 16 public class RunCommand implements Callable { 17 private final String [] args; 18 19 public RunCommand(String ... args) { 20 this.args = args; 21 } 22 23 public Object call() throws Throwable { 24 26 PluginManagerInterceptor.setListener(new PluginManagerListener() { 27 public void preExecute(MavenProject project, MojoExecution exec, PlexusConfiguration mergedConfig, ExpressionEvaluator eval) throws IOException , InterruptedException , AbortException { 28 System.out.println("***** "+exec.getMojoDescriptor().getGoal()); 29 } 30 31 public void postExecute(MavenProject project, MojoExecution exec, PlexusConfiguration mergedConfig, ExpressionEvaluator eval) throws IOException , InterruptedException , AbortException { 32 System.out.println("==== "+exec.getMojoDescriptor().getGoal()); 33 } 34 }); 35 36 return Main.launch(args); 37 } 38 } 39 | Popular Tags |