must initialise the whole plugin, even if already loaded, as only some mojos may have been processed

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@163453 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brett Leslie Porter 2005-03-03 11:42:30 +00:00
parent c8bd83c848
commit bc4d75dedb
3 changed files with 15 additions and 22 deletions

View File

@ -157,8 +157,7 @@ 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(); )
{
@ -171,7 +170,7 @@ public class DefaultLifecycleExecutor
phase.getGoals().add( mojoDescriptor.getId() );
}
}
}
}
private void processGoalChain( String task, MavenSession session )

View File

@ -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;
}
}

View File

@ -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 );