mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-18 06:22:29 +00:00
capturing the actual Mojo object and making it available to MavenReporters.
git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@6347 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
1 parent
52f4300c25
commit
bcaa465612
5 files changed
+33
-12
No files matched your search
@@ -19,6 +19,7 @@ import org.apache.maven.lifecycle.LifecycleExecutorInterceptor;
|
||||
import org.apache.maven.lifecycle.LifecycleExecutorListener;
|
||||
import org.apache.maven.monitor.event.EventDispatcher;
|
||||
import org.apache.maven.plugin.MojoExecution;
|
||||
import org.apache.maven.plugin.Mojo;
|
||||
import org.apache.maven.project.MavenProject;
|
||||
import org.codehaus.classworlds.NoSuchRealmException;
|
||||
import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluator;
|
||||
@@ -167,18 +168,18 @@ public abstract class MavenBuilder implements DelegatingCallable<Result,IOExcept
|
||||
fireLeaveModule();
|
||||
}
|
||||
|
||||
public void preExecute(MavenProject project, MojoExecution exec, PlexusConfiguration mergedConfig, ExpressionEvaluator eval) throws IOException, InterruptedException {
|
||||
public void preExecute(MavenProject project, MojoExecution exec, Mojo mojo, PlexusConfiguration mergedConfig, ExpressionEvaluator eval) throws IOException, InterruptedException {
|
||||
if(lastModule!=project) {
|
||||
// module change
|
||||
fireLeaveModule();
|
||||
fireEnterModule(project);
|
||||
}
|
||||
|
||||
listener.preExecute(project, new MojoInfo(exec, mergedConfig, eval));
|
||||
listener.preExecute(project, new MojoInfo(exec, mojo, mergedConfig, eval));
|
||||
}
|
||||
|
||||
public void postExecute(MavenProject project, MojoExecution exec, PlexusConfiguration mergedConfig, ExpressionEvaluator eval, Exception exception) throws IOException, InterruptedException {
|
||||
listener.postExecute(project, new MojoInfo(exec, mergedConfig, eval),exception);
|
||||
public void postExecute(MavenProject project, MojoExecution exec, Mojo mojo, PlexusConfiguration mergedConfig, ExpressionEvaluator eval, Exception exception) throws IOException, InterruptedException {
|
||||
listener.postExecute(project, new MojoInfo(exec, mojo, mergedConfig, eval),exception);
|
||||
}
|
||||
|
||||
private void fireEnterModule(MavenProject project) throws InterruptedException, IOException {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package hudson.maven;
|
||||
|
||||
import org.apache.maven.plugin.MojoExecution;
|
||||
import org.apache.maven.plugin.Mojo;
|
||||
import org.codehaus.plexus.configuration.PlexusConfiguration;
|
||||
import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluator;
|
||||
import org.codehaus.plexus.component.configurator.converters.lookup.ConverterLookup;
|
||||
@@ -33,6 +34,11 @@ public final class MojoInfo {
|
||||
*/
|
||||
public final PluginName pluginName;
|
||||
|
||||
/**
|
||||
* Mojo object that carries out the actual execution.
|
||||
*/
|
||||
public final Mojo mojo;
|
||||
|
||||
/**
|
||||
* Configuration of the mojo for the current execution.
|
||||
* This reflects the default values, as well as values configured from POM,
|
||||
@@ -52,7 +58,8 @@ public final class MojoInfo {
|
||||
*/
|
||||
private final ConverterLookup converterLookup = new DefaultConverterLookup();
|
||||
|
||||
public MojoInfo(MojoExecution mojoExecution, PlexusConfiguration configuration, ExpressionEvaluator expressionEvaluator) {
|
||||
public MojoInfo(MojoExecution mojoExecution, Mojo mojo, PlexusConfiguration configuration, ExpressionEvaluator expressionEvaluator) {
|
||||
this.mojo = mojo;
|
||||
this.mojoExecution = mojoExecution;
|
||||
this.configuration = configuration;
|
||||
this.expressionEvaluator = expressionEvaluator;
|
||||
|
||||
Reference in new issue
Block a user