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/test/resources/org/apache/maven/plugin integrated-plugin.xml
Date Wed, 09 Jun 2004 19:28:51 GMT
jvanzyl     2004/06/09 12:28:51

  Modified:    maven-core/src/main/java/org/apache/maven/plugin
                        MavenPluginDescriptor.java
                        MavenPluginDiscoverer.java
               maven-core/src/test/java/org/apache/maven/plugin
                        PluginTest.java
               maven-core/src/test/resources/org/apache/maven/plugin
                        integrated-plugin.xml
  Log:
  o account for the possibility of there being many mojos in a plugin where
    each mojo is a component.
  
  Revision  Changes    Path
  1.2       +4 -4      maven-components/maven-core/src/main/java/org/apache/maven/plugin/MavenPluginDescriptor.java
  
  Index: MavenPluginDescriptor.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-core/src/main/java/org/apache/maven/plugin/MavenPluginDescriptor.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- MavenPluginDescriptor.java	20 May 2004 17:09:30 -0000	1.1
  +++ MavenPluginDescriptor.java	9 Jun 2004 19:28:51 -0000	1.2
  @@ -1,7 +1,7 @@
   package org.apache.maven.plugin;
   
  +import org.apache.maven.plugin.descriptor.MojoDescriptor;
   import org.codehaus.plexus.component.repository.ComponentDescriptor;
  -import org.apache.maven.plugin.descriptor.PluginDescriptor;
   
   import java.util.List;
   
  @@ -12,9 +12,9 @@
   public class MavenPluginDescriptor
       extends ComponentDescriptor
   {
  -    private PluginDescriptor pluginDescriptor;
  +    private MojoDescriptor pluginDescriptor;
   
  -    public MavenPluginDescriptor( PluginDescriptor pluginDescriptor )
  +    public MavenPluginDescriptor( MojoDescriptor pluginDescriptor )
       {
           this.pluginDescriptor = pluginDescriptor;
       }
  
  
  
  1.3       +7 -2      maven-components/maven-core/src/main/java/org/apache/maven/plugin/MavenPluginDiscoverer.java
  
  Index: MavenPluginDiscoverer.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-core/src/main/java/org/apache/maven/plugin/MavenPluginDiscoverer.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- MavenPluginDiscoverer.java	22 May 2004 02:14:30 -0000	1.2
  +++ MavenPluginDiscoverer.java	9 Jun 2004 19:28:51 -0000	1.3
  @@ -18,11 +18,13 @@
   
   import org.apache.maven.plugin.descriptor.PluginDescriptor;
   import org.apache.maven.plugin.descriptor.PluginDescriptorBuilder;
  +import org.apache.maven.plugin.descriptor.MojoDescriptor;
   import org.codehaus.plexus.component.discovery.AbstractComponentDiscoverer;
   
   import java.io.Reader;
   import java.util.ArrayList;
   import java.util.List;
  +import java.util.Iterator;
   
   /**
    * @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
  @@ -67,7 +69,10 @@
               throw new Exception( "Cannot process plugin descriptor: " + source, e );
           }
   
  -        componentDescriptors.add( new MavenPluginDescriptor( pluginDescriptor ) );
  +        for ( Iterator iterator = pluginDescriptor.getMojos().iterator(); iterator.hasNext();
)
  +        {
  +            componentDescriptors.add( new MavenPluginDescriptor( (MojoDescriptor)iterator.next()
) );
  +        }
   
           return componentDescriptors;
       }
  
  
  
  1.11      +4 -3      maven-components/maven-core/src/test/java/org/apache/maven/plugin/PluginTest.java
  
  Index: PluginTest.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-core/src/test/java/org/apache/maven/plugin/PluginTest.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- PluginTest.java	9 Jun 2004 03:10:49 -0000	1.10
  +++ PluginTest.java	9 Jun 2004 19:28:51 -0000	1.11
  @@ -20,6 +20,7 @@
   import org.apache.maven.MavenPlexusComponentTestBase;
   import org.apache.maven.plugin.descriptor.PluginDescriptor;
   import org.apache.maven.plugin.descriptor.PluginDescriptorBuilder;
  +import org.apache.maven.plugin.descriptor.MojoDescriptor;
   import org.apache.maven.plugin.PluginManager;
   import org.apache.maven.plugin.MavenPluginDescriptor;
   
  @@ -61,9 +62,9 @@
   
           PluginDescriptor pd = builder.build( new InputStreamReader( is ) );
   
  -        getContainer().addComponentDescriptor( new MavenPluginDescriptor( pd ) );
  +        getContainer().addComponentDescriptor( new MavenPluginDescriptor( (MojoDescriptor)
pd.getMojos().get(0) ) );
   
  -        pluginMM.processPluginDescriptor( new MavenPluginDescriptor( pd ) );
  +        pluginMM.processPluginDescriptor( new MavenPluginDescriptor( (MojoDescriptor) pd.getMojos().get(0)
) );
       }
   
       public void testFakeOut()
  
  
  
  1.5       +27 -23    maven-components/maven-core/src/test/resources/org/apache/maven/plugin/integrated-plugin.xml
  
  Index: integrated-plugin.xml
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-core/src/test/resources/org/apache/maven/plugin/integrated-plugin.xml,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- integrated-plugin.xml	20 May 2004 17:09:31 -0000	1.4
  +++ integrated-plugin.xml	9 Jun 2004 19:28:51 -0000	1.5
  @@ -1,25 +1,29 @@
   <plugin>
  -  <id>integrated-plugin</id>
  -  <implementation>org.apache.maven.plugin.IntegratedPlugin</implementation>
  -  <instantiationStrategy>singleton</instantiationStrategy>
  -  <mode>integrated</mode>
  -  <goals>
  -    <goal>
  -      <name>integrated-execute</name>
  -      <parameters>
  -        <parameter>
  -          <name>name</name>
  -          <expression>#project.name</expression>
  -        </parameter>
  -        <parameter>
  -          <name>artifactId</name>
  -          <expression>#project.artifactId</expression>
  -        </parameter>
  -        <parameter>
  -          <name>foo</name>
  -          <expression>#foo</expression>
  -        </parameter>
  -      </parameters>
  -    </goal>
  -  </goals>
  +  <mojos>
  +    <mojo>
  +      <id>integrated-plugin</id>
  +      <implementation>org.apache.maven.plugin.IntegratedPlugin</implementation>
  +      <instantiationStrategy>singleton</instantiationStrategy>
  +      <mode>integrated</mode>
  +      <goals>
  +        <goal>
  +          <name>integrated-execute</name>
  +          <parameters>
  +            <parameter>
  +              <name>name</name>
  +              <expression>#project.name</expression>
  +            </parameter>
  +            <parameter>
  +              <name>artifactId</name>
  +              <expression>#project.artifactId</expression>
  +            </parameter>
  +            <parameter>
  +              <name>foo</name>
  +              <expression>#foo</expression>
  +            </parameter>
  +          </parameters>
  +        </goal>
  +      </goals>
  +    </mojo>
  +  </mojos>
   </plugin>
  
  
  

Mime
View raw message