You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by jd...@apache.org on 2005/07/07 05:18:54 UTC
svn commit: r209563 - in /maven/components/trunk:
maven-artifact/src/main/resources/META-INF/plexus/
maven-core/src/main/java/org/apache/maven/lifecycle/
maven-core/src/main/java/org/apache/maven/plugin/
maven-core/src/main/resources/META-INF/plexus/ m...
Author: jdcasey
Date: Wed Jul 6 20:18:53 2005
New Revision: 209563
URL: http://svn.apache.org/viewcvs?rev=209563&view=rev
Log:
Working on: MNG-377
o Added component descriptor for the MavenPluginMappingBuilder
o Added a new ComponentDiscoveryListener implementation to factor the DefaultPluginManager out of the plexus.xml for maven-core...the DefaultPluginManager now delegates to this component for plugin registration/lookup/etc. and has proper component requirements.
o Moved the DefaultPluginManager component declaration into components.xml, and added a component definition for MavenPluginCollector to plexus.xml in maven-core
Next step is to get rid of the old pluginKey junk, and start using o.a.m.Plugin instances to hold g:a:v info for all plugins in the system...this will make the interface cleaner and remove the need to concat/parse the plugin identity. Then, I'll add the mapped-plugin lookup functionality to the lifecycle executor.
Added:
maven/components/trunk/maven-core/src/main/java/org/apache/maven/plugin/MavenPluginCollector.java (with props)
maven/components/trunk/maven-plugin-mapping/src/main/resources/META-INF/
maven/components/trunk/maven-plugin-mapping/src/main/resources/META-INF/plexus/
maven/components/trunk/maven-plugin-mapping/src/main/resources/META-INF/plexus/components.xml (with props)
Modified:
maven/components/trunk/maven-artifact/src/main/resources/META-INF/plexus/components.xml
maven/components/trunk/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java
maven/components/trunk/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java
maven/components/trunk/maven-core/src/main/resources/META-INF/plexus/components.xml
maven/components/trunk/maven-core/src/main/resources/META-INF/plexus/plexus.xml
Modified: maven/components/trunk/maven-artifact/src/main/resources/META-INF/plexus/components.xml
URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-artifact/src/main/resources/META-INF/plexus/components.xml?rev=209563&r1=209562&r2=209563&view=diff
==============================================================================
--- maven/components/trunk/maven-artifact/src/main/resources/META-INF/plexus/components.xml (original)
+++ maven/components/trunk/maven-artifact/src/main/resources/META-INF/plexus/components.xml Wed Jul 6 20:18:53 2005
@@ -138,5 +138,16 @@
<role>org.apache.maven.artifact.resolver.ArtifactCollector</role>
<implementation>org.apache.maven.artifact.resolver.DefaultArtifactCollector</implementation>
</component>
+
+ <component>
+ <role>org.apache.maven.artifact.repository.metadata.RepositoryMetadataManager</role>
+ <role-hint>default</role-hint>
+ <implementation>org.apache.maven.artifact.repository.metadata.DefaultRepositoryMetadataManager</implementation>
+ <requirements>
+ <requirement>
+ <role>org.apache.maven.artifact.manager.WagonManager</role>
+ </requirement>
+ </requirements>
+ </component>
</components>
</component-set>
Modified: maven/components/trunk/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java
URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java?rev=209563&r1=209562&r2=209563&view=diff
==============================================================================
--- maven/components/trunk/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java (original)
+++ maven/components/trunk/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java Wed Jul 6 20:18:53 2005
@@ -35,6 +35,7 @@
import org.apache.maven.plugin.lifecycle.Execution;
import org.apache.maven.plugin.lifecycle.Lifecycle;
import org.apache.maven.plugin.lifecycle.Phase;
+import org.apache.maven.plugin.mapping.MavenPluginMappingBuilder;
import org.apache.maven.plugin.version.PluginVersionResolutionException;
import org.apache.maven.project.MavenProject;
import org.apache.maven.project.injection.ModelDefaultsInjector;
@@ -69,6 +70,8 @@
// ----------------------------------------------------------------------
private ModelDefaultsInjector modelDefaultsInjector;
+
+ private MavenPluginMappingBuilder pluginMappingBuilder;
private PluginManager pluginManager;
Modified: maven/components/trunk/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java
URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java?rev=209563&r1=209562&r2=209563&view=diff
==============================================================================
--- maven/components/trunk/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java (original)
+++ maven/components/trunk/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java Wed Jul 6 20:18:53 2005
@@ -28,6 +28,7 @@
import org.apache.maven.artifact.resolver.filter.InversionArtifactFilter;
import org.apache.maven.artifact.resolver.filter.ScopeArtifactFilter;
import org.apache.maven.execution.MavenSession;
+import org.apache.maven.model.Plugin;
import org.apache.maven.model.ReportSet;
import org.apache.maven.monitor.event.EventDispatcher;
import org.apache.maven.monitor.event.MavenEvents;
@@ -51,9 +52,6 @@
import org.codehaus.plexus.component.configurator.ComponentConfigurator;
import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException;
import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluator;
-import org.codehaus.plexus.component.discovery.ComponentDiscoveryEvent;
-import org.codehaus.plexus.component.discovery.ComponentDiscoveryListener;
-import org.codehaus.plexus.component.repository.ComponentSetDescriptor;
import org.codehaus.plexus.component.repository.exception.ComponentLifecycleException;
import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
import org.codehaus.plexus.configuration.PlexusConfiguration;
@@ -70,7 +68,6 @@
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Collections;
-import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
@@ -79,145 +76,67 @@
public class DefaultPluginManager
extends AbstractLogEnabled
- implements PluginManager, ComponentDiscoveryListener, Initializable, Contextualizable
+ implements PluginManager, Initializable, Contextualizable
{
- protected Map pluginDescriptors;
-
- protected Map pluginIdsByPrefix;
-
protected PlexusContainer container;
protected PluginDescriptorBuilder pluginDescriptorBuilder;
protected ArtifactFilter artifactFilter;
+ private Log mojoLogger;
+
+ // component requirements
protected PathTranslator pathTranslator;
+
+ protected MavenPluginCollector pluginCollector;
+
+ protected PluginVersionManager pluginVersionManager;
+
+ protected ArtifactFactory artifactFactory;
- private Set pluginsInProcess = new HashSet();
+ protected ArtifactResolver artifactResolver;
- private Log mojoLogger;
+ protected MavenProjectBuilder mavenProjectBuilder;
+ // END component requirements
public DefaultPluginManager()
{
- pluginDescriptors = new HashMap();
-
- pluginIdsByPrefix = new HashMap();
-
pluginDescriptorBuilder = new PluginDescriptorBuilder();
}
// ----------------------------------------------------------------------
- // Mojo discovery
- // ----------------------------------------------------------------------
-
- public void componentDiscovered( ComponentDiscoveryEvent event )
- {
- ComponentSetDescriptor componentSetDescriptor = event.getComponentSetDescriptor();
-
- if ( componentSetDescriptor instanceof PluginDescriptor )
- {
- PluginDescriptor pluginDescriptor = (PluginDescriptor) componentSetDescriptor;
-
- // String key = pluginDescriptor.getId();
- // TODO: see comment in getPluginDescriptor
- String key = pluginDescriptor.getGroupId() + ":" + pluginDescriptor.getArtifactId();
-
- if ( !pluginsInProcess.contains( key ) )
- {
- pluginsInProcess.add( key );
-
- pluginDescriptors.put( key, pluginDescriptor );
-
- // TODO: throw an (not runtime) exception if there is a prefix overlap - means doing so elsewhere
- // we also need to deal with multiple versions somehow - currently, first wins
- if ( !pluginIdsByPrefix.containsKey( pluginDescriptor.getGoalPrefix() ) )
- {
- pluginIdsByPrefix.put( pluginDescriptor.getGoalPrefix(), pluginDescriptor.getId() );
- }
- }
- }
- }
-
- // ----------------------------------------------------------------------
//
// ----------------------------------------------------------------------
- private PluginDescriptor getPluginDescriptor( String groupId, String artifactId, String version )
- {
- // String key = PluginDescriptor.constructPluginKey( groupId, artifactId, version );
- // TODO: include version, but can't do this in the plugin manager as it is not resolved to the right version
- // at that point. Instead, move the duplication check to the artifact container, or store it locally based on
- // the unresolved version?
- String key = groupId + ":" + artifactId;
- return (PluginDescriptor) pluginDescriptors.get( key );
- }
-
- private boolean isPluginInstalled( String pluginKey )
- {
- // String key = PluginDescriptor.constructPluginKey( groupId, artifactId, version );
- // TODO: see comment in getPluginDescriptor
- return pluginDescriptors.containsKey( pluginKey );
- }
-
- private boolean isPluginInstalledForPrefix( String prefix )
- {
- return pluginIdsByPrefix.containsKey( prefix );
- }
-
public String getPluginIdFromPrefix( String prefix )
{
- if ( !isPluginInstalledForPrefix( prefix ) )
- {
- // TODO: lookup remotely
- }
- return (String) pluginIdsByPrefix.get( prefix );
+ return pluginCollector.getPluginIdFromPrefix( prefix );
}
public PluginDescriptor verifyPlugin( String groupId, String artifactId, String version, MavenProject project,
Settings settings, ArtifactRepository localRepository )
throws ArtifactResolutionException, PluginManagerException, PluginVersionResolutionException
{
- String pluginKey = groupId + ":" + artifactId;
-
// TODO: this should be possibly outside
// [HTTP-301] All version-resolution logic has been moved to DefaultPluginVersionManager. :)
if ( version == null )
{
- PluginVersionManager pluginVersionManager = null;
-
- try
- {
- pluginVersionManager = (PluginVersionManager) container.lookup( PluginVersionManager.ROLE );
-
- version = pluginVersionManager.resolvePluginVersion( groupId, artifactId, project, settings,
- localRepository );
- }
- catch ( ComponentLookupException e )
- {
- throw new PluginVersionResolutionException( groupId, artifactId,
- "Cannot retrieve an instance of the PluginVersionManager",
- e );
- }
- finally
- {
- releaseComponent( pluginVersionManager );
- }
+ version = pluginVersionManager.resolvePluginVersion( groupId, artifactId, project, settings,
+ localRepository );
}
// TODO: this might result in an artifact "RELEASE" being resolved continuously
- if ( !isPluginInstalled( pluginKey ) )
+ if ( !pluginCollector.isPluginInstalled( groupId, artifactId ) )
{
- ArtifactFactory artifactFactory = null;
try
{
- artifactFactory = (ArtifactFactory) container.lookup( ArtifactFactory.ROLE );
-
Artifact pluginArtifact = artifactFactory.createArtifact( groupId, artifactId, version,
Artifact.SCOPE_RUNTIME,
MojoDescriptor.MAVEN_PLUGIN );
-
- addPlugin( pluginKey, pluginArtifact, project, localRepository );
-
+
+ addPlugin( groupId, artifactId, version, pluginArtifact, project, localRepository );
+
version = pluginArtifact.getBaseVersion();
}
catch ( PlexusContainerException e )
@@ -240,69 +159,44 @@
throw e;
}
}
- catch ( ComponentLookupException e )
- {
- throw new PluginManagerException(
- "Internal configuration error while retrieving " + groupId + ":" + artifactId, e );
- }
- finally
- {
- if ( artifactFactory != null )
- {
- releaseComponent( artifactFactory );
- }
-
- }
}
- return getPluginDescriptor( groupId, artifactId, version );
+ return pluginCollector.getPluginDescriptor( groupId, artifactId, version );
}
- protected void addPlugin( String pluginKey, Artifact pluginArtifact, MavenProject project,
+ protected void addPlugin( String groupId, String artifactId, String version, Artifact pluginArtifact, MavenProject project,
ArtifactRepository localRepository )
- throws ArtifactResolutionException, ComponentLookupException, PlexusContainerException
- {
- ArtifactResolver artifactResolver = null;
-
- try
- {
- artifactResolver = (ArtifactResolver) container.lookup( ArtifactResolver.ROLE );
-
- artifactResolver.resolve( pluginArtifact, project.getPluginArtifactRepositories(), localRepository );
-
- PlexusContainer child = container.createChildContainer( pluginKey, Collections
- .singletonList( pluginArtifact.getFile() ), Collections.EMPTY_MAP, Collections.singletonList( this ) );
-
- // this plugin's descriptor should have been discovered in the child creation, so we should be able to
- // circle around and set the artifacts and class realm
- PluginDescriptor addedPlugin = (PluginDescriptor) pluginDescriptors.get( pluginKey );
-
- addedPlugin.setClassRealm( child.getContainerRealm() );
-
- // we're only setting the plugin's artifact itself as the artifact list, to allow it to be retrieved
- // later when the plugin is first invoked. Retrieving this artifact will in turn allow us to
- // transitively resolve its dependencies, and add them to the plugin container...
- addedPlugin.setArtifacts( Collections.singletonList( pluginArtifact ) );
- }
- finally
- {
- if ( artifactResolver != null )
- {
- releaseComponent( artifactResolver );
- }
- }
- }
-
- private void releaseComponent( Object component )
+ throws ArtifactResolutionException, PlexusContainerException
{
- try
- {
- container.release( component );
- }
- catch ( ComponentLifecycleException e )
- {
- getLogger().error( "Error releasing component - ignoring", e );
- }
- }
+ String pluginKey = Plugin.constructKey( groupId, artifactId );
+
+ artifactResolver.resolve( pluginArtifact, project.getPluginArtifactRepositories(), localRepository );
+
+ PlexusContainer child = container.createChildContainer( pluginKey, Collections
+ .singletonList( pluginArtifact.getFile() ), Collections.EMPTY_MAP, Collections.singletonList( pluginCollector ) );
+
+ // this plugin's descriptor should have been discovered in the child creation, so we should be able to
+ // circle around and set the artifacts and class realm
+ PluginDescriptor addedPlugin = pluginCollector.getPluginDescriptor( groupId, artifactId, version );
+
+ addedPlugin.setClassRealm( child.getContainerRealm() );
+
+ // we're only setting the plugin's artifact itself as the artifact list, to allow it to be retrieved
+ // later when the plugin is first invoked. Retrieving this artifact will in turn allow us to
+ // transitively resolve its dependencies, and add them to the plugin container...
+ addedPlugin.setArtifacts( Collections.singletonList( pluginArtifact ) );
+ }
+
+// private void releaseComponent( Object component )
+// {
+// try
+// {
+// container.release( component );
+// }
+// catch ( ComponentLifecycleException e )
+// {
+// getLogger().error( "Error releasing component - ignoring", e );
+// }
+// }
// ----------------------------------------------------------------------
// Mojo execution
@@ -316,39 +210,10 @@
if ( mojoDescriptor.isDependencyResolutionRequired() != null )
{
- ArtifactResolver artifactResolver = null;
- MavenProjectBuilder mavenProjectBuilder = null;
- ArtifactFactory artifactFactory = null;
-
- try
- {
- artifactResolver = (ArtifactResolver) container.lookup( ArtifactResolver.ROLE );
- mavenProjectBuilder = (MavenProjectBuilder) container.lookup( MavenProjectBuilder.ROLE );
- artifactFactory = (ArtifactFactory) container.lookup( ArtifactFactory.ROLE );
-
- resolveTransitiveDependencies( session, artifactResolver, mavenProjectBuilder, mojoDescriptor
- .isDependencyResolutionRequired(), artifactFactory, project );
- downloadDependencies( project, session, artifactResolver );
- }
- catch ( ComponentLookupException e )
- {
- throw new PluginManagerException( "Internal configuration error in plugin manager", e );
- }
- finally
- {
- if ( artifactResolver != null )
- {
- releaseComponent( artifactResolver );
- }
- if ( mavenProjectBuilder != null )
- {
- releaseComponent( mavenProjectBuilder );
- }
- if ( artifactFactory != null )
- {
- releaseComponent( artifactFactory );
- }
- }
+ resolveTransitiveDependencies( session, artifactResolver, mavenProjectBuilder, mojoDescriptor
+ .isDependencyResolutionRequired(), artifactFactory, project );
+
+ downloadDependencies( project, session, artifactResolver );
}
String goalName = mojoDescriptor.getFullGoalName();
@@ -430,7 +295,7 @@
MavenSession session, MavenProject project )
throws PluginManagerException, PluginVersionResolutionException, PluginConfigurationException
{
- PluginDescriptor pluginDescriptor = getPluginDescriptor( groupId, artifactId, version );
+ PluginDescriptor pluginDescriptor = pluginCollector.getPluginDescriptor( groupId, artifactId, version );
List reports = new ArrayList();
for ( Iterator i = pluginDescriptor.getMojos().iterator(); i.hasNext(); )
@@ -533,7 +398,7 @@
private void ensurePluginContainerIsComplete( PluginDescriptor pluginDescriptor, PlexusContainer pluginContainer,
MavenProject project, MavenSession session )
- throws PluginConfigurationException, ComponentLookupException
+ throws PluginConfigurationException
{
// if the plugin's already been used once, don't re-do this step...
// otherwise, we have to finish resolving the plugin's classpath and start the container.
@@ -542,19 +407,11 @@
// TODO: this is a little shady...
Artifact pluginArtifact = (Artifact) pluginDescriptor.getArtifacts().get( 0 );
- ArtifactResolver artifactResolver = null;
- MavenProjectBuilder mavenProjectBuilder = null;
- ArtifactFactory artifactFactory = null;
-
try
{
- artifactResolver = (ArtifactResolver) container.lookup( ArtifactResolver.ROLE );
- mavenProjectBuilder = (MavenProjectBuilder) container.lookup( MavenProjectBuilder.ROLE );
- artifactFactory = (ArtifactFactory) container.lookup( ArtifactFactory.ROLE );
-
MavenMetadataSource metadataSource = new MavenMetadataSource( artifactResolver, mavenProjectBuilder,
artifactFactory );
-
+
List remoteRepositories = new ArrayList();
remoteRepositories.addAll( project.getRemoteArtifactRepositories() );
@@ -563,44 +420,44 @@
ArtifactRepository localRepository = session.getLocalRepository();
Set dependencies = metadataSource.retrieve( pluginArtifact, localRepository,
project.getPluginArtifactRepositories() );
-
+
ArtifactResolutionResult result = artifactResolver.resolveTransitively( dependencies, pluginArtifact,
localRepository,
remoteRepositories,
metadataSource,
artifactFilter );
-
+
Set resolved = result.getArtifacts();
-
+
for ( Iterator it = resolved.iterator(); it.hasNext(); )
{
Artifact artifact = (Artifact) it.next();
-
+
if ( artifact != pluginArtifact )
{
pluginContainer.addJarResource( artifact.getFile() );
}
}
-
+
pluginDescriptor.setClassRealm( pluginContainer.getContainerRealm() );
-
+
// TODO: this is probably overkill as it is rarely used - can we use a mojo tag to signal this will be
// used or check its configuration? Also, when it is used, perhaps it is more effecient to resolve
// everything at once and apply the exclusion filter when constructing the plugin container above.
// Check this out with yourkit
ArtifactFilter distroProvidedFilter = new InversionArtifactFilter( artifactFilter );
-
+
ArtifactResolutionResult distroProvidedResult = artifactResolver
.resolveTransitively( dependencies, pluginArtifact, localRepository, remoteRepositories,
metadataSource, distroProvidedFilter );
-
+
Set distroProvided = distroProvidedResult.getArtifacts();
-
+
List unfilteredArtifactList = new ArrayList( resolved.size() + distroProvided.size() );
-
+
unfilteredArtifactList.addAll( resolved );
unfilteredArtifactList.addAll( distroProvided );
-
+
pluginDescriptor.setArtifacts( unfilteredArtifactList );
}
catch ( ArtifactResolutionException e )
@@ -615,21 +472,6 @@
{
throw new PluginConfigurationException( "Cannot resolve plugin dependencies", e );
}
- finally
- {
- if ( artifactFactory != null )
- {
- releaseComponent( artifactFactory );
- }
- if ( artifactResolver != null )
- {
- releaseComponent( artifactResolver );
- }
- if ( mavenProjectBuilder != null )
- {
- releaseComponent( mavenProjectBuilder );
- }
- }
}
}
@@ -1034,8 +876,6 @@
artifactFactory );
ArtifactFilter filter = new ScopeArtifactFilter( scope );
-
- boolean systemOnline = !context.getSettings().isOffline();
// TODO: such a call in MavenMetadataSource too - packaging not really the intention of type
Artifact artifact = artifactFactory.createArtifact( project.getGroupId(), project.getArtifactId(),
Added: maven/components/trunk/maven-core/src/main/java/org/apache/maven/plugin/MavenPluginCollector.java
URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-core/src/main/java/org/apache/maven/plugin/MavenPluginCollector.java?rev=209563&view=auto
==============================================================================
--- maven/components/trunk/maven-core/src/main/java/org/apache/maven/plugin/MavenPluginCollector.java (added)
+++ maven/components/trunk/maven-core/src/main/java/org/apache/maven/plugin/MavenPluginCollector.java Wed Jul 6 20:18:53 2005
@@ -0,0 +1,80 @@
+package org.apache.maven.plugin;
+
+import org.apache.maven.model.Plugin;
+import org.apache.maven.plugin.descriptor.PluginDescriptor;
+import org.codehaus.plexus.component.discovery.ComponentDiscoveryEvent;
+import org.codehaus.plexus.component.discovery.ComponentDiscoveryListener;
+import org.codehaus.plexus.component.repository.ComponentSetDescriptor;
+import org.codehaus.plexus.logging.AbstractLogEnabled;
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+public class MavenPluginCollector
+ extends AbstractLogEnabled
+ implements ComponentDiscoveryListener
+{
+
+ private Set pluginsInProcess = new HashSet();
+
+ private Map pluginDescriptors = new HashMap();
+
+ private Map pluginIdsByPrefix = new HashMap();
+
+ // ----------------------------------------------------------------------
+ // Mojo discovery
+ // ----------------------------------------------------------------------
+ public void componentDiscovered( ComponentDiscoveryEvent event )
+ {
+ ComponentSetDescriptor componentSetDescriptor = event.getComponentSetDescriptor();
+
+ if ( componentSetDescriptor instanceof PluginDescriptor )
+ {
+ PluginDescriptor pluginDescriptor = (PluginDescriptor) componentSetDescriptor;
+
+ // String key = pluginDescriptor.getId();
+ // TODO: see comment in getPluginDescriptor
+ String key = pluginDescriptor.getGroupId() + ":" + pluginDescriptor.getArtifactId();
+
+ if ( !pluginsInProcess.contains( key ) )
+ {
+ pluginsInProcess.add( key );
+
+ pluginDescriptors.put( key, pluginDescriptor );
+
+ // TODO: throw an (not runtime) exception if there is a prefix overlap - means doing so elsewhere
+ // we also need to deal with multiple versions somehow - currently, first wins
+ if ( !pluginIdsByPrefix.containsKey( pluginDescriptor.getGoalPrefix() ) )
+ {
+ pluginIdsByPrefix.put( pluginDescriptor.getGoalPrefix(), pluginDescriptor.getId() );
+ }
+ }
+ }
+ }
+
+ public PluginDescriptor getPluginDescriptor( String groupId, String artifactId, String version )
+ {
+ // TODO: include version, but can't do this in the plugin manager as it is not resolved to the right version
+ // at that point. Instead, move the duplication check to the artifact container, or store it locally based on
+ // the unresolved version?
+ return (PluginDescriptor) pluginDescriptors.get( Plugin.constructKey( groupId, artifactId ) );
+ }
+
+ public boolean isPluginInstalled( String groupId, String artifactId )
+ {
+ // String key = PluginDescriptor.constructPluginKey( groupId, artifactId, version );
+ // TODO: see comment in getPluginDescriptor
+ return pluginDescriptors.containsKey( Plugin.constructKey( groupId, artifactId ) );
+ }
+
+ public String getPluginIdFromPrefix( String prefix )
+ {
+ if ( !pluginIdsByPrefix.containsKey( prefix ) )
+ {
+ // TODO: lookup remotely
+ }
+ return (String) pluginIdsByPrefix.get( prefix );
+ }
+}
Propchange: maven/components/trunk/maven-core/src/main/java/org/apache/maven/plugin/MavenPluginCollector.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/components/trunk/maven-core/src/main/java/org/apache/maven/plugin/MavenPluginCollector.java
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Modified: maven/components/trunk/maven-core/src/main/resources/META-INF/plexus/components.xml
URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-core/src/main/resources/META-INF/plexus/components.xml?rev=209563&r1=209562&r2=209563&view=diff
==============================================================================
--- maven/components/trunk/maven-core/src/main/resources/META-INF/plexus/components.xml (original)
+++ maven/components/trunk/maven-core/src/main/resources/META-INF/plexus/components.xml Wed Jul 6 20:18:53 2005
@@ -1,5 +1,35 @@
<component-set>
<components>
+ <component>
+ <role>org.apache.maven.plugin.PluginManager</role>
+ <implementation>org.apache.maven.plugin.DefaultPluginManager</implementation>
+ <requirements>
+ <requirement>
+ <role>org.apache.maven.project.path.PathTranslator</role>
+ </requirement>
+ <requirement>
+ <role>org.apache.maven.plugin.MavenPluginCollector</role>
+ </requirement>
+ <requirement>
+ <role>org.apache.maven.plugin.version.PluginVersionManager</role>
+ </requirement>
+ <requirement>
+ <role>org.apache.maven.artifact.factory.ArtifactFactory</role>
+ </requirement>
+ <requirement>
+ <role>org.apache.maven.artifact.resolver.ArtifactResolver</role>
+ </requirement>
+ <requirement>
+ <role>org.apache.maven.project.MavenProjectBuilder</role>
+ </requirement>
+ </requirements>
+ </component>
+
+ <!-- Duplicated from Maven core as it is used in the plugin manager -->
+ <component>
+ <role>org.apache.maven.project.path.PathTranslator</role>
+ <implementation>org.apache.maven.project.path.DefaultPathTranslator</implementation>
+ </component>
<!--
|
|
@@ -69,6 +99,9 @@
</requirement>
<requirement>
<role>org.apache.maven.project.injection.ModelDefaultsInjector</role>
+ </requirement>
+ <requirement>
+ <role>org.apache.maven.plugin.mapping.MavenPluginMappingBuilder</role>
</requirement>
</requirements>
<configuration>
Modified: maven/components/trunk/maven-core/src/main/resources/META-INF/plexus/plexus.xml
URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-core/src/main/resources/META-INF/plexus/plexus.xml?rev=209563&r1=209562&r2=209563&view=diff
==============================================================================
--- maven/components/trunk/maven-core/src/main/resources/META-INF/plexus/plexus.xml (original)
+++ maven/components/trunk/maven-core/src/main/resources/META-INF/plexus/plexus.xml Wed Jul 6 20:18:53 2005
@@ -2,7 +2,7 @@
<component-discoverer-manager implementation="org.codehaus.plexus.component.discovery.DefaultComponentDiscovererManager">
<listeners>
<listener implementation="org.codehaus.plexus.component.discovery.DiscoveryListenerDescriptor">
- <role>org.apache.maven.plugin.PluginManager</role>
+ <role>org.apache.maven.plugin.MavenPluginCollector</role>
</listener>
</listeners>
<component-discoverers>
@@ -11,19 +11,8 @@
</component-discoverer-manager>
<components>
<component>
- <role>org.apache.maven.plugin.PluginManager</role>
- <implementation>org.apache.maven.plugin.DefaultPluginManager</implementation>
- <requirements>
- <requirement>
- <role>org.apache.maven.project.path.PathTranslator</role>
- </requirement>
- </requirements>
- </component>
-
- <!-- Duplicated from Maven core as it is used in the plugin manager -->
- <component>
- <role>org.apache.maven.project.path.PathTranslator</role>
- <implementation>org.apache.maven.project.path.DefaultPathTranslator</implementation>
+ <role>org.apache.maven.plugin.MavenPluginCollector</role>
+ <implementation>org.apache.maven.plugin.MavenPluginCollector</implementation>
</component>
</components>
</plexus>
Added: maven/components/trunk/maven-plugin-mapping/src/main/resources/META-INF/plexus/components.xml
URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-plugin-mapping/src/main/resources/META-INF/plexus/components.xml?rev=209563&view=auto
==============================================================================
--- maven/components/trunk/maven-plugin-mapping/src/main/resources/META-INF/plexus/components.xml (added)
+++ maven/components/trunk/maven-plugin-mapping/src/main/resources/META-INF/plexus/components.xml Wed Jul 6 20:18:53 2005
@@ -0,0 +1,16 @@
+<component-set>
+ <components>
+
+ <component>
+ <role>org.apache.maven.plugin.mapping.MavenPluginMappingBuilder</role>
+ <role-hint>default</role-hint>
+ <implementation>org.apache.maven.plugin.mapping.DefaultPluginMappingBuilder</implementation>
+ <requirements>
+ <requirement>
+ <role>org.apache.maven.artifact.repository.metadata.RepositoryMetadataManager</role>
+ </requirement>
+ </requirements>
+ </component>
+
+ </components>
+</component-set>
Propchange: maven/components/trunk/maven-plugin-mapping/src/main/resources/META-INF/plexus/components.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/components/trunk/maven-plugin-mapping/src/main/resources/META-INF/plexus/components.xml
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org