diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java b/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java index a9c37b0a89..4f3c30904c 100644 --- a/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java +++ b/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java @@ -157,21 +157,20 @@ public class DefaultLifecycleExecutor private void processPluginPhases( String pluginId, MavenSession mavenSession ) throws Exception { - if ( pluginManager.verifyPlugin( pluginId, mavenSession ) ) + pluginManager.verifyPlugin( pluginId, mavenSession ); + PluginDescriptor pluginDescriptor = pluginManager.getPluginDescriptor( pluginId ); + for ( Iterator j = pluginDescriptor.getMojos().iterator(); j.hasNext(); ) { - PluginDescriptor pluginDescriptor = pluginManager.getPluginDescriptor( pluginId ); - for ( Iterator j = pluginDescriptor.getMojos().iterator(); j.hasNext(); ) - { - MojoDescriptor mojoDescriptor = (MojoDescriptor) j.next(); + MojoDescriptor mojoDescriptor = (MojoDescriptor) j.next(); - // TODO: check if the goal exists in the configuration and is disabled - if ( mojoDescriptor.getPhase() != null ) - { - Phase phase = (Phase) phaseMap.get( mojoDescriptor.getPhase() ); - phase.getGoals().add( mojoDescriptor.getId() ); - } + // TODO: check if the goal exists in the configuration and is disabled + if ( mojoDescriptor.getPhase() != null ) + { + Phase phase = (Phase) phaseMap.get( mojoDescriptor.getPhase() ); + phase.getGoals().add( mojoDescriptor.getId() ); } } + } private void processGoalChain( String task, MavenSession session ) 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 93160c274d..ee7ec8fc0a 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 @@ -192,16 +192,16 @@ public class DefaultPluginManager } // TODO: don't throw Exception - public boolean verifyPluginForGoal( String goalName, MavenSession session ) + public void verifyPluginForGoal( String goalName, MavenSession session ) throws Exception { String pluginId = getPluginId( goalName ); - return verifyPlugin( pluginId, session ); + verifyPlugin( pluginId, session ); } // TODO: don't throw Exception - public boolean verifyPlugin( String pluginId, MavenSession session ) + public void verifyPlugin( String pluginId, MavenSession session ) throws Exception { if ( !isPluginInstalled( pluginId ) ) @@ -217,12 +217,6 @@ public class DefaultPluginManager Artifact pluginArtifact = new DefaultArtifact( "maven", artifactId, version, "plugin", "jar" ); addPlugin( pluginArtifact, session ); - - return true; - } - else - { - return false; } } 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 7f2b07fa4f..eae34d3dfa 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 @@ -36,11 +36,11 @@ public interface PluginManager MojoDescriptor getMojoDescriptor( String goalId ); // TODO: don't throw Exception - boolean verifyPluginForGoal( String goalName, MavenSession session ) + void verifyPluginForGoal( String goalName, MavenSession session ) throws Exception; // TODO: don't throw Exception - boolean verifyPlugin( String pluginId, MavenSession session ) + void verifyPlugin( String pluginId, MavenSession session ) throws Exception; PluginDescriptor getPluginDescriptor( String pluginId );