You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by dk...@apache.org on 2007/02/12 17:32:35 UTC

svn commit: r506524 - in /maven/sandbox/plugins/maven-remote-resources-plugin: pom.xml src/main/java/org/apache/maven/plugin/resources/remote/ProcessRemoteResourcesMojo.java

Author: dkulp
Date: Mon Feb 12 08:32:34 2007
New Revision: 506524

URL: http://svn.apache.org/viewvc?view=rev&rev=506524
Log:
Fixes for MRRESOURCES-8, MRRESOURCES-9, MRRESOURCES-10
Also update pom for non-snapshot parent.


Modified:
    maven/sandbox/plugins/maven-remote-resources-plugin/pom.xml
    maven/sandbox/plugins/maven-remote-resources-plugin/src/main/java/org/apache/maven/plugin/resources/remote/ProcessRemoteResourcesMojo.java

Modified: maven/sandbox/plugins/maven-remote-resources-plugin/pom.xml
URL: http://svn.apache.org/viewvc/maven/sandbox/plugins/maven-remote-resources-plugin/pom.xml?view=diff&rev=506524&r1=506523&r2=506524
==============================================================================
--- maven/sandbox/plugins/maven-remote-resources-plugin/pom.xml (original)
+++ maven/sandbox/plugins/maven-remote-resources-plugin/pom.xml Mon Feb 12 08:32:34 2007
@@ -21,7 +21,7 @@
   <parent>
     <groupId>org.apache.maven.plugins</groupId>
     <artifactId>maven-plugins</artifactId>
-    <version>8-SNAPSHOT</version>
+    <version>8</version>
   </parent>
   <modelVersion>4.0.0</modelVersion>
   <artifactId>maven-remote-resources-plugin</artifactId>

Modified: maven/sandbox/plugins/maven-remote-resources-plugin/src/main/java/org/apache/maven/plugin/resources/remote/ProcessRemoteResourcesMojo.java
URL: http://svn.apache.org/viewvc/maven/sandbox/plugins/maven-remote-resources-plugin/src/main/java/org/apache/maven/plugin/resources/remote/ProcessRemoteResourcesMojo.java?view=diff&rev=506524&r1=506523&r2=506524
==============================================================================
--- maven/sandbox/plugins/maven-remote-resources-plugin/src/main/java/org/apache/maven/plugin/resources/remote/ProcessRemoteResourcesMojo.java (original)
+++ maven/sandbox/plugins/maven-remote-resources-plugin/src/main/java/org/apache/maven/plugin/resources/remote/ProcessRemoteResourcesMojo.java Mon Feb 12 08:32:34 2007
@@ -58,8 +58,10 @@
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.Enumeration;
+import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
+import java.util.Map;
 
 /**
  * Pull down resourceBundles containing remote resources and process the resources contained
@@ -114,6 +116,22 @@
      * @required
      */
     private ArrayList resourceBundles;
+
+
+    /**
+     * Additional properties to be passed to velocity.
+     *
+     * Several properties are automatically added:
+     *   project - the current MavenProject 
+     *   projects - the list of dependency projects
+     *   projectTimespan - the timespan of the current project (requires inceptionYear in pom)
+     *
+     * See <a href="http://maven.apache.org/ref/current/maven-project/apidocs/org/apache/maven/project/MavenProject.html">
+     * the javadoc for MavenProject</a> for information about the properties on the MavenProject. 
+     *
+     * @parameter
+     */
+    private Map properties = new HashMap();
     
     /**
      * The list of resources defined for the project.
@@ -248,7 +266,7 @@
 
         InputStreamReader reader = null;
 
-        VelocityContext context = new VelocityContext();
+        VelocityContext context = new VelocityContext(properties);
 
         context.put( "project", project );
         context.put( "projects", getProjects() );
@@ -416,6 +434,9 @@
             {
                 //TODO - should use filters here
                 FileUtils.copyFile(source, file);
+                
+                //exclude the original (so eclipse doesn't complain about duplicate resources)
+                resource.addExclude(relFileName);
                 
                 return true;
             }