diff --git a/maven-core/src/main/java/org/apache/maven/Maven.java b/maven-core/src/main/java/org/apache/maven/Maven.java index 4f6c32fec1..05a6b85d3c 100644 --- a/maven-core/src/main/java/org/apache/maven/Maven.java +++ b/maven-core/src/main/java/org/apache/maven/Maven.java @@ -27,7 +27,6 @@ import org.apache.maven.execution.ReactorManager; /** * @author Jason van Zyl - * @version $Id$ */ public interface Maven { diff --git a/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java b/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java index 2ab5ffc10a..afb9465e6a 100644 --- a/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java +++ b/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java @@ -353,9 +353,11 @@ public class DefaultPluginManager // We should assume that We've already loaded the plugin in question. - public void executeMojo( MavenProject project, MojoExecution mojoExecution, MavenSession session ) + public void executeMojo( MojoExecution mojoExecution, MavenSession session ) throws MojoFailureException, PluginExecutionException, PluginConfigurationException { + MavenProject project = session.getCurrentProject(); + MojoDescriptor mojoDescriptor = mojoExecution.getMojoDescriptor(); if ( mojoDescriptor.isProjectRequired() && !session.isUsingPOMsFromFilesystem() ) diff --git a/maven-core/src/main/java/org/apache/maven/plugin/MavenPluginDiscoverer.java b/maven-core/src/main/java/org/apache/maven/plugin/MavenPluginDiscoverer.java index e9cf958597..5d6f3ee1fa 100644 --- a/maven-core/src/main/java/org/apache/maven/plugin/MavenPluginDiscoverer.java +++ b/maven-core/src/main/java/org/apache/maven/plugin/MavenPluginDiscoverer.java @@ -28,10 +28,11 @@ import org.codehaus.plexus.configuration.PlexusConfigurationException; import java.io.Reader; +//TODO: collapse this into the plugin manager + /** * @author Jason van Zyl * @author Trygve Laugstøl - * @version $Id$ */ @Component( role=ComponentDiscoverer.class) public class MavenPluginDiscoverer diff --git a/maven-core/src/main/java/org/apache/maven/plugin/PluginManager.java b/maven-core/src/main/java/org/apache/maven/plugin/PluginManager.java index f3d200b242..794442c8d3 100644 --- a/maven-core/src/main/java/org/apache/maven/plugin/PluginManager.java +++ b/maven-core/src/main/java/org/apache/maven/plugin/PluginManager.java @@ -39,7 +39,6 @@ public interface PluginManager MojoDescriptor getMojoDescriptor( Plugin plugin, String goal, MavenSession session ) throws PluginLoaderException; - //!!jvz The current project is contained in the session - void executeMojo( MavenProject project, MojoExecution execution, MavenSession session ) + void executeMojo( MojoExecution execution, MavenSession session ) throws MojoFailureException, PluginExecutionException, PluginConfigurationException; } \ No newline at end of file diff --git a/maven-core/src/test/java/org/apache/maven/plugin/PluginManagerTest.java b/maven-core/src/test/java/org/apache/maven/plugin/PluginManagerTest.java index 944308515a..e86a966342 100644 --- a/maven-core/src/test/java/org/apache/maven/plugin/PluginManagerTest.java +++ b/maven-core/src/test/java/org/apache/maven/plugin/PluginManagerTest.java @@ -87,7 +87,7 @@ public class PluginManagerTest MojoDescriptor mojoDescriptor = pluginManager.getMojoDescriptor( plugin, goal, session ); assertPluginDescriptor( mojoDescriptor, "org.apache.maven.plugins", "maven-remote-resources-plugin", "1.1" ); MojoExecution mojoExecution = new MojoExecution( mojoDescriptor ); - pluginManager.executeMojo( session.getCurrentProject(), mojoExecution, session ); + pluginManager.executeMojo( mojoExecution, session ); } public void testSurefirePlugin() @@ -104,7 +104,7 @@ public class PluginManagerTest MojoDescriptor mojoDescriptor = pluginManager.getMojoDescriptor( plugin, goal, session ); assertPluginDescriptor( mojoDescriptor, "org.apache.maven.plugins", "maven-surefire-plugin", "2.4.2" ); MojoExecution mojoExecution = new MojoExecution( mojoDescriptor ); - pluginManager.executeMojo( session.getCurrentProject(), mojoExecution, session ); + pluginManager.executeMojo( mojoExecution, session ); } // -----------------------------------------------------------------------------------------------