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 2007/02/15 00:32:45 UTC
svn commit: r507742 - in /maven/plugins/trunk/maven-remote-resources-plugin:
pom.xml
src/main/java/org/apache/maven/plugin/resources/remote/ProcessRemoteResourcesMojo.java
Author: jvanzyl
Date: Wed Feb 14 15:32:41 2007
New Revision: 507742
URL: http://svn.apache.org/viewvc?view=rev&rev=507742
Log:
MRRESOURCES-8 - Add "properties" map to allow additional properties to be sent to velocity.
Documented the auto-added properties.
MRRESOURCES-9 - In https://svn.apache.org/repos/asf/maven/sandbox/resources/apache-jar-resource-bundle
The template takes an "addLicense" property (requires MRRESOURCES-8) to add license
information for each dependency
MRRESOURCES-10 - exclude the original override files so generated projects don't complain
Submitted by: Dan Kulp
Modified:
maven/plugins/trunk/maven-remote-resources-plugin/pom.xml
maven/plugins/trunk/maven-remote-resources-plugin/src/main/java/org/apache/maven/plugin/resources/remote/ProcessRemoteResourcesMojo.java
Modified: maven/plugins/trunk/maven-remote-resources-plugin/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-remote-resources-plugin/pom.xml?view=diff&rev=507742&r1=507741&r2=507742
==============================================================================
--- maven/plugins/trunk/maven-remote-resources-plugin/pom.xml (original)
+++ maven/plugins/trunk/maven-remote-resources-plugin/pom.xml Wed Feb 14 15:32:41 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/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=507742&r1=507741&r2=507742
==============================================================================
--- 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 Wed Feb 14 15:32:41 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;
}