maven-m2-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jvan...@apache.org
Subject cvs commit: maven-components/maven-core/src/main/java/org/apache/maven/plugin DefaultPluginManager.java
Date Wed, 06 Oct 2004 14:30:36 GMT
jvanzyl     2004/10/06 07:30:35

  Modified:    maven-core/src/main/java/org/apache/maven/plugin
                        DefaultPluginManager.java
  Log:
  o use the new api in maven-artifact
  
  Revision  Changes    Path
  1.12      +20 -10    maven-components/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java
  
  Index: DefaultPluginManager.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- DefaultPluginManager.java	23 Sep 2004 16:53:20 -0000	1.11
  +++ DefaultPluginManager.java	6 Oct 2004 14:30:35 -0000	1.12
  @@ -17,6 +17,8 @@
   import org.apache.maven.artifact.handler.manager.ArtifactHandlerManager;
   import org.apache.maven.artifact.repository.ArtifactRepository;
   import org.apache.maven.artifact.resolver.ArtifactResolver;
  +import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
  +import org.apache.maven.artifact.resolver.filter.ExclusionSetFilter;
   import org.apache.maven.plugin.descriptor.MojoDescriptor;
   import org.apache.maven.plugin.descriptor.PluginDescriptor;
   import org.apache.maven.plugin.descriptor.PluginDescriptorBuilder;
  @@ -31,8 +33,6 @@
   import org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable;
   import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable;
   import org.codehaus.plexus.util.dag.CycleDetectedException;
  -import org.codehaus.plexus.util.dag.DAG;
  -import org.codehaus.plexus.util.dag.TopologicalSorter;
   
   import java.util.HashMap;
   import java.util.HashSet;
  @@ -63,6 +63,8 @@
   
       protected ArtifactRepository localRepository;
   
  +    protected ArtifactFilter artifactFilter;
  +
       public DefaultPluginManager()
       {
           mojoDescriptors = new HashMap();
  @@ -108,7 +110,7 @@
               MavenMojoDescriptor mavenMojoDescriptor = (MavenMojoDescriptor) it.next();
   
               MojoDescriptor mojoDescriptor = mavenMojoDescriptor.getMojoDescriptor();
  -            
  +
               mojoDescriptors.put( mojoDescriptor.getId(), mojoDescriptor );
   
               pluginDescriptors.put( pluginDescriptor.getId(), pluginDescriptor );
  @@ -123,7 +125,7 @@
       {
           ComponentSetDescriptor componentSetDescriptor = event.getComponentSetDescriptor();
   
  -        if ( !(componentSetDescriptor instanceof MavenPluginDescriptor) )
  +        if ( !( componentSetDescriptor instanceof MavenPluginDescriptor ) )
           {
               return;
           }
  @@ -201,12 +203,7 @@
   
           MavenMetadataSource sr = new MavenMetadataSource( remotePluginRepositories, localRepository,
artifactResolver );
   
  -        // TODO: needs to be configurable
  -        String[] excludes = new String[] { "maven-core", "maven-artifact", "maven-model",
"maven-plugin", "plexus",
  -            "xstream", "xpp3", "classworlds", "ognl" };
  -
  -        container.addComponent( pluginArtifact, artifactResolver, remotePluginRepositories,
localRepository, sr,
  -            excludes );
  +        container.addComponent( pluginArtifact, artifactResolver, remotePluginRepositories,
localRepository, sr, artifactFilter );
       }
   
       public void contextualize( Context context )
  @@ -218,6 +215,19 @@
       public void initialize()
           throws Exception
       {
  +        artifactFilter = new ExclusionSetFilter( new String[]
  +        {
  +            "maven-core",
  +            "maven-artifact",
  +            "maven-model",
  +            "maven-plugin",
  +            "plexus",
  +            "xstream",
  +            "xpp3",
  +            "classworlds",
  +            "ognl"
  +        } );
  +
           // TODO: move this to be configurable from the Maven component
           remotePluginRepositories = new HashSet();
   
  
  
  

Mime
View raw message