You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by jv...@apache.org on 2006/11/28 22:38:50 UTC

svn commit: r480217 - in /maven/plugins/trunk/maven-remote-resources-plugin/src: main/java/org/apache/maven/plugin/resources/remote/ site/apt/

Author: jvanzyl
Date: Tue Nov 28 13:38:48 2006
New Revision: 480217

URL: http://svn.apache.org/viewvc?view=rev&rev=480217
Log:
o adding descriptions for parameters
o fleshing out usage doco

Modified:
    maven/plugins/trunk/maven-remote-resources-plugin/src/main/java/org/apache/maven/plugin/resources/remote/BundleRemoteResourcesMojo.java
    maven/plugins/trunk/maven-remote-resources-plugin/src/main/java/org/apache/maven/plugin/resources/remote/ProcessRemoteResourcesMojo.java
    maven/plugins/trunk/maven-remote-resources-plugin/src/site/apt/usage.apt

Modified: maven/plugins/trunk/maven-remote-resources-plugin/src/main/java/org/apache/maven/plugin/resources/remote/BundleRemoteResourcesMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-remote-resources-plugin/src/main/java/org/apache/maven/plugin/resources/remote/BundleRemoteResourcesMojo.java?view=diff&rev=480217&r1=480216&r2=480217
==============================================================================
--- maven/plugins/trunk/maven-remote-resources-plugin/src/main/java/org/apache/maven/plugin/resources/remote/BundleRemoteResourcesMojo.java (original)
+++ maven/plugins/trunk/maven-remote-resources-plugin/src/main/java/org/apache/maven/plugin/resources/remote/BundleRemoteResourcesMojo.java Tue Nov 28 13:38:48 2006
@@ -26,11 +26,15 @@
     public static final String RESOURCES_MANIFEST = "META-INF/maven/remote-resources.xml";
 
     /**
+     * The directory which contains the resources you want packaged up in this resource bundle.
+     *
      * @parameter expression="${basedir}/src/main/resources"
      */
     private File resourcesDirectory;
 
     /**
+     * The directory where you want the resource bundle manifest written to.
+     * 
      * @parameter expression="${project.build.outputDirectory}"
      */
     private File outputDirectory;

Modified: maven/plugins/trunk/maven-remote-resources-plugin/src/main/java/org/apache/maven/plugin/resources/remote/ProcessRemoteResourcesMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-remote-resources-plugin/src/main/java/org/apache/maven/plugin/resources/remote/ProcessRemoteResourcesMojo.java?view=diff&rev=480217&r1=480216&r2=480217
==============================================================================
--- maven/plugins/trunk/maven-remote-resources-plugin/src/main/java/org/apache/maven/plugin/resources/remote/ProcessRemoteResourcesMojo.java (original)
+++ maven/plugins/trunk/maven-remote-resources-plugin/src/main/java/org/apache/maven/plugin/resources/remote/ProcessRemoteResourcesMojo.java Tue Nov 28 13:38:48 2006
@@ -50,7 +50,7 @@
 import java.util.Iterator;
 
 /**
- * Pull down artifacts containing remote resources and process the resources contained
+ * Pull down resourceBundles containing remote resources and process the resources contained
  * inside the artifact.
  *
  * @goal process
@@ -60,51 +60,62 @@
     extends AbstractMojo
 {
     /**
+     * The local repository taken from Maven's runtime. Typically $HOME/.m2/repository.
+     *
      * @parameter expression="${localRepository}
      */
     private ArtifactRepository localRepository;
 
     /**
+     * The remote repositories used as specified in your POM.
+     *
      * @parameter expression="${project.repositories}
      */
     private ArrayList remoteRepositories;
 
     /**
+     * The current Maven project.
+     *
      * @parameter expression="${project}"
      */
     private MavenProject project;
 
     /**
+     * The directory where processed resources will be placed for packaging.
+     *
      * @parameter expression="${project.build.outputDirectory}"
      */
     private File outputDirectory;
 
     /**
+     * The resource bundles that will be retrieved and processed.
+     *
      * @parameter
      */
-    private ArrayList artifacts;
+    private ArrayList resourceBundles;
 
     /**
+     * Artifact downloader.
+     *
      * @component
      */
     private Downloader downloader;
 
     /**
+     * Velocity component.
+     *
      * @component
      */
     private VelocityComponent velocity;
 
-    /**
-     * @parameter expression="${workDirectory}" default-value="${project.build.directory}/remote-resources"
-     */
-    private File workDirectory;
-
     // These two things make this horrible. Maven artifact is way too complicated and the relationship between
     // the model usage and maven-artifact needs to be reworked as well as all our tools that deal with it. The
     // ProjectUtils should be a component so I don't have to expose the container and artifact factory here. Can't
     // change it now because it's not released ...
 
     /**
+     * Artifact repository factory component.
+     *
      * @component
      */
     private ArtifactRepositoryFactory artifactRepositoryFactory;
@@ -124,7 +135,7 @@
 
         RemoteResourcesClassLoader classLoader = new RemoteResourcesClassLoader();
 
-        for ( Iterator i = artifacts.iterator(); i.hasNext(); )
+        for ( Iterator i = resourceBundles.iterator(); i.hasNext(); )
         {
             String artifactDescriptor = (String) i.next();
 

Modified: maven/plugins/trunk/maven-remote-resources-plugin/src/site/apt/usage.apt
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-remote-resources-plugin/src/site/apt/usage.apt?view=diff&rev=480217&r1=480216&r2=480217
==============================================================================
--- maven/plugins/trunk/maven-remote-resources-plugin/src/site/apt/usage.apt (original)
+++ maven/plugins/trunk/maven-remote-resources-plugin/src/site/apt/usage.apt Tue Nov 28 13:38:48 2006
@@ -10,8 +10,7 @@
 
 * How to Create a Resource Bundle
 
- In order to turn on the bundle resource manifest generation you need to configure the 
- plugin as follows.
+ To turn on the bundle resource manifest generation you need to configure the plugin as follows:
 
 -------------------
 <project>
@@ -32,7 +31,6 @@
     </plugins>
   </build>
 </project>
-
 ------------------- 
  
  This will triggering the scanning of your <<<${basedir}/src/main/resources>>> directory and create the
@@ -40,6 +38,34 @@
  
 * How to Use Remote Resource Bundles 
 
+ To use remote resource bundles you need to configure the plugin as follows:
+
+-------------------
+<project>
+  ...
+  <build>
+    <plugins>
+      <!-- Turn this into a lifecycle -->
+      <plugin>
+        <artifactId>maven-remote-resources-plugin</artifactId>
+        <executions>
+          <execution>
+            <goals>
+              <goal>process</goal>
+            </goals>
+            <configuration>
+              <resourceBundles>
+                <resourceBundle>org.apache:apache-jar-resource-bundle:1.0-SNAPSHOT</resourceBundle>
+              </resourceBundles>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+</project>
 -------------------
 
--------------------
\ No newline at end of file
+ This will retrieve the <<<apache-jar-resource-bundle-1.0-SNAPSHOT.jar>>> from the remote repositories
+ specified in your POM, process each resource in the bundle and deposit them in your projects
+ <<<${basedir}/target/classes>>> directory. 
\ No newline at end of file