mirror of https://github.com/apache/maven.git
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:
parent
29a95ef261
commit
3ef5e97f42
|
@ -1654,45 +1654,6 @@ public class DefaultPluginManager
|
||||||
return plugin;
|
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 )
|
public String resolvePluginVersion( String groupId, String artifactId, MavenProject project, MavenSession session )
|
||||||
throws PluginVersionResolutionException, InvalidPluginException, PluginVersionNotFoundException
|
throws PluginVersionResolutionException, InvalidPluginException, PluginVersionNotFoundException
|
||||||
{
|
{
|
||||||
|
|
|
@ -44,15 +44,6 @@ public interface PluginManager
|
||||||
Plugin findPluginForPrefix( String prefix, MavenProject project, MavenSession session )
|
Plugin findPluginForPrefix( String prefix, MavenProject project, MavenSession session )
|
||||||
throws PluginLoaderException;
|
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 )
|
PluginDescriptor loadPlugin( Plugin plugin, MavenProject project, MavenSession session )
|
||||||
throws PluginLoaderException;
|
throws PluginLoaderException;
|
||||||
|
|
||||||
|
|
|
@ -169,24 +169,6 @@ public class MavenEmbedder
|
||||||
return request;
|
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
|
// Accessors
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
|
|
|
@ -40,3 +40,5 @@ public class MercuryRepositorySystemTest
|
||||||
_mrs = getContainer().lookup( RepositorySystem.class, "mercury" );
|
_mrs = getContainer().lookup( RepositorySystem.class, "mercury" );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue