mirror of https://github.com/apache/maven.git
o removing some more dead code
git-svn-id: https://svn.apache.org/repos/asf/maven/components/branches/MNG-2766@769857 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
5a7ab7d748
commit
453c10ac9f
|
@ -21,7 +21,6 @@ import java.net.MalformedURLException;
|
|||
import java.net.URL;
|
||||
import java.net.URLConnection;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Enumeration;
|
||||
import java.util.HashMap;
|
||||
|
@ -95,8 +94,10 @@ import org.codehaus.plexus.util.xml.Xpp3Dom;
|
|||
// TODO: separate out project downloading
|
||||
// TODO: template method plugin validation as its framework specific
|
||||
// TODO: provide a method to get default configuraiton for a given plugin
|
||||
//TODO: get rid of all the custom configuration merging here, that's domain specific but needs to incorporate defaults the plugin manager can provide
|
||||
//TODO: the antrun plugin has its own configurator, the only plugin that does. might need to think about how that works
|
||||
// TODO: get rid of all the custom configuration merging here, that's domain specific but needs to
|
||||
// incorporate defaults the plugin manager can provide
|
||||
// TODO: the antrun plugin has its own configurator, the only plugin that does. might need to think
|
||||
// about how that works
|
||||
// TODO: merge the plugin collector into the plugin manager
|
||||
// TODO: merge the plugin discovery listener into the plugin manager
|
||||
|
||||
|
@ -125,8 +126,6 @@ public class DefaultPluginManager
|
|||
@Requirement
|
||||
protected MavenProjectBuilder mavenProjectBuilder;
|
||||
|
||||
private Map<String,Plugin> pluginDefinitionsByPrefix = new HashMap<String,Plugin>();
|
||||
|
||||
private Map<String, PluginDescriptor> pluginDescriptors;
|
||||
|
||||
public DefaultPluginManager()
|
||||
|
@ -254,7 +253,6 @@ public class DefaultPluginManager
|
|||
// its dependencies while filtering out what's in the core
|
||||
// layering on the project level plugin dependencies
|
||||
|
||||
|
||||
private Set<Artifact> getPluginArtifacts( Artifact pluginArtifact, Plugin plugin, MavenProject project, ArtifactRepository localRepository )
|
||||
throws InvalidPluginException, ArtifactNotFoundException, ArtifactResolutionException
|
||||
{
|
||||
|
@ -314,14 +312,8 @@ public class DefaultPluginManager
|
|||
// followed by the plugin's default artifact set
|
||||
dependencies.addAll( pluginArtifacts );
|
||||
|
||||
ArtifactResolutionRequest request = new ArtifactResolutionRequest()
|
||||
.setArtifact( pluginArtifact )
|
||||
.setArtifactDependencies( dependencies )
|
||||
.setLocalRepository( localRepository )
|
||||
.setRemoteRepostories( new ArrayList( project.getRemoteArtifactRepositories() ) )
|
||||
.setManagedVersionMap( pluginManagedDependencies )
|
||||
.setFilter( filter )
|
||||
.setResolveRoot( false ); // We are setting this to false because the artifact itself has been resolved.
|
||||
ArtifactResolutionRequest request = new ArtifactResolutionRequest().setArtifact( pluginArtifact ).setArtifactDependencies( dependencies ).setLocalRepository( localRepository )
|
||||
.setRemoteRepostories( new ArrayList( project.getRemoteArtifactRepositories() ) ).setManagedVersionMap( pluginManagedDependencies ).setFilter( filter ).setResolveRoot( false ); // We are setting this to false because the artifact itself has been resolved.
|
||||
|
||||
ArtifactResolutionResult result = repositorySystem.resolve( request );
|
||||
resolutionErrorHandler.throwErrors( request, result );
|
||||
|
@ -589,7 +581,8 @@ public class DefaultPluginManager
|
|||
}
|
||||
}
|
||||
|
||||
private void checkDeprecatedParameters( MojoDescriptor mojoDescriptor, PlexusConfiguration extractedMojoConfiguration ) throws PlexusConfigurationException
|
||||
private void checkDeprecatedParameters( MojoDescriptor mojoDescriptor, PlexusConfiguration extractedMojoConfiguration )
|
||||
throws PlexusConfigurationException
|
||||
{
|
||||
if ( ( extractedMojoConfiguration == null ) || ( extractedMojoConfiguration.getChildCount() < 1 ) )
|
||||
{
|
||||
|
@ -902,13 +895,8 @@ public class DefaultPluginManager
|
|||
|
||||
ArtifactFilter filter = new ScopeArtifactFilter( scope );
|
||||
|
||||
ArtifactResolutionRequest request = new ArtifactResolutionRequest()
|
||||
.setArtifact( artifact )
|
||||
.setResolveRoot( false )
|
||||
.setArtifactDependencies( project.getDependencyArtifacts() )
|
||||
.setLocalRepository( session.getLocalRepository() )
|
||||
.setRemoteRepostories( new ArrayList( project.getRemoteArtifactRepositories() ) )
|
||||
.setManagedVersionMap( project.getManagedVersionMap() )
|
||||
ArtifactResolutionRequest request = new ArtifactResolutionRequest().setArtifact( artifact ).setResolveRoot( false ).setArtifactDependencies( project.getDependencyArtifacts() )
|
||||
.setLocalRepository( session.getLocalRepository() ).setRemoteRepostories( new ArrayList( project.getRemoteArtifactRepositories() ) ).setManagedVersionMap( project.getManagedVersionMap() )
|
||||
.setFilter( filter );
|
||||
|
||||
ArtifactResolutionResult result = repositorySystem.resolve( request );
|
||||
|
@ -1128,8 +1116,6 @@ public class DefaultPluginManager
|
|||
|
||||
private Set pluginsInProcess = new HashSet();
|
||||
|
||||
private Map pluginIdsByPrefix = new HashMap();
|
||||
|
||||
public void componentDiscovered( ComponentDiscoveryEvent event )
|
||||
{
|
||||
ComponentSetDescriptor componentSetDescriptor = event.getComponentSetDescriptor();
|
||||
|
@ -1149,21 +1135,11 @@ public class DefaultPluginManager
|
|||
}
|
||||
}
|
||||
|
||||
public String getId()
|
||||
{
|
||||
return "maven-plugin-collector";
|
||||
}
|
||||
|
||||
public PluginDescriptor getPluginDescriptor( Plugin plugin )
|
||||
{
|
||||
return pluginDescriptors.get( constructPluginKey( plugin ) );
|
||||
}
|
||||
|
||||
public Collection<PluginDescriptor> getPluginDescriptors()
|
||||
{
|
||||
return pluginDescriptors.values();
|
||||
}
|
||||
|
||||
private String constructPluginKey( Plugin plugin )
|
||||
{
|
||||
String version = ArtifactUtils.toSnapshotVersion( plugin.getVersion() );
|
||||
|
@ -1175,25 +1151,4 @@ public class DefaultPluginManager
|
|||
String version = ArtifactUtils.toSnapshotVersion( pluginDescriptor.getVersion() );
|
||||
return pluginDescriptor.getGroupId() + ":" + pluginDescriptor.getArtifactId() + ":" + version;
|
||||
}
|
||||
|
||||
public boolean isPluginInstalled( Plugin plugin )
|
||||
{
|
||||
String key = constructPluginKey( plugin );
|
||||
return pluginDescriptors.containsKey( key );
|
||||
}
|
||||
|
||||
public Set<PluginDescriptor> getPluginDescriptorsForPrefix( String prefix )
|
||||
{
|
||||
Set result = new HashSet();
|
||||
for ( Iterator it = pluginDescriptors.values().iterator(); it.hasNext(); )
|
||||
{
|
||||
PluginDescriptor pd = (PluginDescriptor) it.next();
|
||||
if ( pd.getGoalPrefix().equals( prefix ) )
|
||||
{
|
||||
result.add( pd );
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue