mirror of https://github.com/apache/maven.git
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:
parent
c8bd83c848
commit
bc4d75dedb
|
@ -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 )
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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 );
|
||||
|
|
Loading…
Reference in New Issue