o reduce the foot print of the plugin manager, the interaction between the lifecycle executor and plugin manager is far too intimate

git-svn-id: https://svn.apache.org/repos/asf/maven/components/branches/MNG-2766@751459 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jason van Zyl 2009-03-08 16:25:35 +00:00
parent 29a95ef261
commit 3ef5e97f42
4 changed files with 2 additions and 66 deletions

View File

@ -1654,45 +1654,6 @@ public class DefaultPluginManager
return plugin;
}
// Plugin Context
public Collection<MojoExecution> getMojoExecutionsForGoal( String goal )
throws Exception
{
List<MojoExecution> mojoExecutions = new ArrayList<MojoExecution>();
for ( PluginDescriptor descriptor : pluginCollector.getPluginDescriptors() )
{
MojoDescriptor mojoDescriptor = descriptor.getMojo( goal );
if ( mojoDescriptor != null )
{
MojoExecution mojoExecution = new MojoExecution( mojoDescriptor );
mojoExecution.setConfiguration( Xpp3DomBuilder.build( new StringReader( mojoDescriptor.getMojoConfiguration().toString() ) ) );
mojoExecutions.add( mojoExecution );
}
}
return mojoExecutions;
}
public Object getMojoParameterFor( MojoExecution mojoExecution, String xPath )
throws Exception
{
Xpp3Dom mojoDescriptorConfiguration = Xpp3DomBuilder.build( new StringReader( mojoExecution.getMojoDescriptor().getMojoConfiguration().toString() ) );
Xpp3Dom mergedConfig = Xpp3Dom.mergeXpp3Dom( mojoExecution.getConfiguration(), mojoDescriptorConfiguration );
return JXPathContext.newContext( mergedConfig ).getValue( xPath );
}
public void executeMojo( MojoExecution mojoExecution, MavenSession session )
throws Exception
{
executeMojo( session.getCurrentProject(), mojoExecution, session );
}
// Version Manager
public String resolvePluginVersion( String groupId, String artifactId, MavenProject project, MavenSession session )
throws PluginVersionResolutionException, InvalidPluginException, PluginVersionNotFoundException
{

View File

@ -43,15 +43,6 @@ public interface PluginManager
Plugin findPluginForPrefix( String prefix, MavenProject project, MavenSession session )
throws PluginLoaderException;
Collection<MojoExecution> getMojoExecutionsForGoal( String goal )
throws Exception;
Object getMojoParameterFor( MojoExecution mojoExecution, String xPath )
throws Exception;
void executeMojo( MojoExecution mojoExecution, MavenSession session )
throws Exception;
PluginDescriptor loadPlugin( Plugin plugin, MavenProject project, MavenSession session )
throws PluginLoaderException;

View File

@ -169,24 +169,6 @@ public class MavenEmbedder
return request;
}
public Collection<MojoExecution> getMojoExecutionsForGoal(String goal)
throws Exception
{
return pluginManager.getMojoExecutionsForGoal( goal );
}
public Object getMojoParameterFor(MojoExecution mojoExecution, String xPath)
throws Exception
{
return pluginManager.getMojoParameterFor( mojoExecution, xPath);
}
public void executeMojo(MojoExecution mojoExecution, MavenSession mavenSession )
throws Exception
{
pluginManager.executeMojo( mojoExecution, mavenSession );
}
// ----------------------------------------------------------------------
// Accessors
// ----------------------------------------------------------------------

View File

@ -40,3 +40,5 @@ public class MercuryRepositorySystemTest
_mrs = getContainer().lookup( RepositorySystem.class, "mercury" );
}
}