jvanzyl     2004/05/20 10:05:23

  Modified:    maven-plugins/maven-resources-plugin project.xml
               
maven-plugins/maven-resources-plugin/src/main/java/org/apache/maven/plugin
                        ResourcesPlugin.java
               maven-plugins/maven-resources-plugin/src/main/resources/META-INF/maven
                        plugin.xml
  Log:
  turn into a maven plugin and add @tags for descriptor generation.
  
  Revision  Changes    Path
  1.4       +1 -45     
maven-components/maven-plugins/maven-resources-plugin/project.xml
  
  Index: project.xml
  ===================================================================
  RCS file: 
/home/cvs/maven-components/maven-plugins/maven-resources-plugin/project.xml,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- project.xml       12 Apr 2004 20:14:19 -0000      1.3
  +++ project.xml       20 May 2004 17:05:23 -0000      1.4
  @@ -9,14 +9,8 @@
     <groupId>maven</groupId>
     <artifactId>maven-resources-plugin</artifactId>
     <name>Maven</name>
  -  <currentVersion>1.0-SNAPSHOT</currentVersion>
  -  <inceptionYear>2001</inceptionYear>
  +  <version>1.0-SNAPSHOT</version>
     <package>org.apache.maven</package>
  -  <repository>
  -    <connection>scm:cvs:pserver:[EMAIL 
PROTECTED]:/home/cvspublic:maven-components/maven-plugins/maven-resources-plugin</connection>
  -    <developerConnection>scm:cvs:ext:[EMAIL 
PROTECTED]:/home/cvs:maven-components/maven-plugins/maven-resources-plugin</developerConnection>
  -    <url>http://cvs.apache.org/viewcvs.cgi/maven/</url>
  -  </repository>
     <dependencies>
       <dependency>
         <groupId>maven</groupId>
  @@ -32,44 +26,6 @@
         <groupId>maven</groupId>
         <artifactId>maven-project</artifactId>
         <version>2.0-SNAPSHOT</version>
  -    </dependency>
  -    <dependency>
  -      <groupId>commons-cli</groupId>
  -      <artifactId>commons-cli</artifactId>
  -      <version>1.0-beta-2</version>
  -    </dependency>
  -
  -    <!-- Plexus -->
  -
  -    <dependency>
  -      <groupId>xpp3</groupId>
  -      <artifactId>xpp3</artifactId>
  -      <version>1.1.3.3</version>
  -    </dependency>
  -    <dependency>
  -      <groupId>plexus</groupId>
  -      <artifactId>plexus</artifactId>
  -      <version>0.14-SNAPSHOT</version>
  -    </dependency>
  -    <dependency>
  -      <groupId>plexus</groupId>
  -      <artifactId>plexus-i18n</artifactId>
  -      <version>1.0-beta-2-SNAPSHOT</version>
  -    </dependency>
  -    <dependency>
  -      <groupId>classworlds</groupId>
  -      <artifactId>classworlds</artifactId>
  -      <version>1.1-SNAPSHOT</version>
  -    </dependency>
  -    <dependency>
  -      <groupId>xstream</groupId>
  -      <artifactId>xstream</artifactId>
  -      <version>1.0-SNAPSHOT</version>
  -    </dependency>
  -    <dependency>
  -      <groupId>plexus</groupId>
  -      <artifactId>plexus-compiler</artifactId>
  -      <version>1.0-SNAPSHOT</version>
       </dependency>
     </dependencies>
   </project>
  
  
  
  1.4       +32 -16    
maven-components/maven-plugins/maven-resources-plugin/src/main/java/org/apache/maven/plugin/ResourcesPlugin.java
  
  Index: ResourcesPlugin.java
  ===================================================================
  RCS file: 
/home/cvs/maven-components/maven-plugins/maven-resources-plugin/src/main/java/org/apache/maven/plugin/ResourcesPlugin.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ResourcesPlugin.java      19 Mar 2004 04:15:16 -0000      1.3
  +++ ResourcesPlugin.java      20 May 2004 17:05:23 -0000      1.4
  @@ -68,30 +68,46 @@
   import java.util.List;
   
   /**
  + * @maven.plugin.id resources
  + * @maven.plugin.description Maven plugin to build jars
  + *
  + * @parameter outputDirectory String true validator description
  + * @parameter resources List true validator description
  + *
  + * @goal.name resources
  + * @goal.resources.description copy application resources
  + * @goal.resources.parameter outputDirectory #maven.build.dest
  + * @goal.resources.parameter resources #project.build.resources
  + *
  + * @goal.name test:resources
  + * @goal.test:resources.description copy test resources
  + * @goal.test:resources.parameter outputDirectory #maven.test.dest
  + * @goal.test:resources.parameter resources #project.build.unitTest.resources
    *
    * @author <a href="[EMAIL PROTECTED]">Michal Maczka</a>
  + * @author <a href="mailto:[EMAIL PROTECTED]">Jason van Zyl</a>
  + *
    * @version $Id$
    *
  - * maven.jar.manifest.extensions.add
  - * maven.jar.includes
  - * maven.jar.excludes
  - * maven.jar.index
  - * maven.jar.compress
  - * maven.remote.group
  - *
  - * @todo separate this into a resources plugin and jar plugin so that the resource
  - * copying can be used as part of testing, right now the resources are being copied
  - * directly into the JAR, need to make them available to testing.
    */
   public class ResourcesPlugin
  +    extends AbstractPlugin
   {
  -    private String outputDirectory;
  -
  -    private List resources;
  -
  -    public void execute()
  +    public void execute( PluginExecutionRequest request, PluginExecutionResponse 
response )
           throws Exception
       {
  +        // ----------------------------------------------------------------------
  +        //
  +        // ----------------------------------------------------------------------
  +
  +        String outputDirectory = (String) request.getParameter( "outputDirectory" );
  +
  +        List resources = (List) request.getParameter( "resources" );
  +
  +        // ----------------------------------------------------------------------
  +        //
  +        // ----------------------------------------------------------------------
  +
           for ( Iterator i = getJarResources( resources ).iterator(); i.hasNext(); )
           {
               ResourceEntry resourceEntry = (ResourceEntry) i.next();
  
  
  
  1.6       +22 -4     
maven-components/maven-plugins/maven-resources-plugin/src/main/resources/META-INF/maven/plugin.xml
  
  Index: plugin.xml
  ===================================================================
  RCS file: 
/home/cvs/maven-components/maven-plugins/maven-resources-plugin/src/main/resources/META-INF/maven/plugin.xml,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- plugin.xml        22 Mar 2004 18:11:45 -0000      1.5
  +++ plugin.xml        20 May 2004 17:05:23 -0000      1.6
  @@ -1,11 +1,28 @@
   <plugin>
  -  <id>resource-copier</id>
  +  <id>resources</id>
     <implementation>org.apache.maven.plugin.ResourcesPlugin</implementation>
  -  <instantiation-strategy>per-lookup</instantiation-strategy>
  -  <mode>field</mode>
  +  <instantiationStrategy>singleton</instantiationStrategy>
  +  <mode>integrated</mode>
  +  <parameters>
  +    <parameter>
  +      <name>outputDirectory</name>
  +      <type>String</type>
  +      <required>false</required>
  +      <validator>validator</validator>
  +      <description>description </description>
  +    </parameter>
  +    <parameter>
  +      <name>resources</name>
  +      <type>List</type>
  +      <required>false</required>
  +      <validator>validator</validator>
  +      <description>description </description>
  +    </parameter>
  +  </parameters>
     <goals>
       <goal>
         <name>resources</name>
  +      <description>copy application resources</description>
         <parameters>
           <parameter>
             <name>outputDirectory</name>
  @@ -19,6 +36,7 @@
       </goal>
       <goal>
         <name>test:resources</name>
  +      <description>copy test resources</description>
         <parameters>
           <parameter>
             <name>outputDirectory</name>
  @@ -31,4 +49,4 @@
         </parameters>
       </goal>
     </goals>
  -</plugin>
  +</plugin>
  \ No newline at end of file
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to