You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by de...@apache.org on 2008/01/12 21:03:17 UTC
svn commit: r611471 - in
/maven/plugins/trunk/maven-remote-resources-plugin/src:
main/java/org/apache/maven/plugin/resources/remote/ main/mdo/ site/apt/
site/fml/
Author: dennisl
Date: Sat Jan 12 12:03:16 2008
New Revision: 611471
URL: http://svn.apache.org/viewvc?rev=611471&view=rev
Log:
o Improve documentation.
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/main/mdo/remote-resources.mdo
maven/plugins/trunk/maven-remote-resources-plugin/src/main/mdo/supplemental-model.mdo
maven/plugins/trunk/maven-remote-resources-plugin/src/site/apt/index.apt
maven/plugins/trunk/maven-remote-resources-plugin/src/site/fml/faq.fml
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?rev=611471&r1=611470&r2=611471&view=diff
==============================================================================
--- 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 Sat Jan 12 12:03:16 2008
@@ -35,7 +35,7 @@
import java.io.FileWriter;
/**
- * Bundle up the resources that should be considered as a remote-resource
+ * Bundle up resources that should be considered as a remote-resource.
*
* @goal bundle
* @phase generate-resources
@@ -44,7 +44,7 @@
extends AbstractMojo
{
public static final String RESOURCES_MANIFEST = "META-INF/maven/remote-resources.xml";
-
+
private static final String[] DEFAULT_INCLUDES = new String [] {
"**/*.txt",
"**/*.vm",
@@ -60,39 +60,38 @@
/**
* The directory where you want the resource bundle manifest written to.
- *
+ *
* @parameter expression="${project.build.outputDirectory}"
*/
private File outputDirectory;
-
-
+
/**
* A list of files to include. Can contain ant-style wildcards and double wildcards.
* The default includes are
* <code>**/*.txt **/*.vm</code>
- *
+ *
* @parameter
* @since 1.0-alpha-5
*/
private String[] includes;
/**
- * A list of files to exclude. Can contain ant-style wildcards and double wildcards.
+ * A list of files to exclude. Can contain ant-style wildcards and double wildcards.
*
* @parameter
* @since 1.0-alpha-5
*/
private String[] excludes;
-
+
public void execute()
throws MojoExecutionException
{
if ( !resourcesDirectory.exists() )
{
return;
- }
-
- // Look at the content of ${basedir}/src/main/resources and create a manifest of the files
+ }
+
+ // Look at the content of the resourcesDirectory and create a manifest of the files
// so that velocity can easily process any resources inside the JAR that need to be processed.
RemoteResourcesBundle remoteResourcesBundle = new RemoteResourcesBundle();
@@ -126,7 +125,7 @@
remoteResourcesBundle.addRemoteResource( StringUtils.replace( resource, '\\', '/' ) );
}
-
+
RemoteResourcesBundleXpp3Writer w = new RemoteResourcesBundleXpp3Writer();
try
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?rev=611471&r1=611470&r2=611471&view=diff
==============================================================================
--- 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 Sat Jan 12 12:03:16 2008
@@ -78,8 +78,10 @@
/**
* <p>
- * Pull down resourceBundles containing remote resources and process the resources contained
- * inside the artifact.
+ * Pull down resourceBundles containing remote resources and process the
+ * resources contained inside. When that is done the resources are injected
+ * into the current (in-memory) Maven project, making them available to the
+ * process-resources phase.
* </p>
* <p>
* Resources that end in ".vm" are treated as velocity templates. For those, the ".vm" is
@@ -315,7 +317,7 @@
VelocityContext context = new VelocityContext( properties );
configureVelocityContext( context );
- RemoteResourcesClassLoader classLoader
+ RemoteResourcesClassLoader classLoader
= new RemoteResourcesClassLoader( null );
initalizeClassloader( classLoader, resourceBundleArtifacts );
Thread.currentThread().setContextClassLoader( classLoader );
@@ -863,7 +865,7 @@
{
return compare(o1, o2) == 0;
}
-
+
private int compareStrings( String s1, String s2 ) {
if ( s1 == null && s2 == null )
{
@@ -877,7 +879,7 @@
{
return -1;
}
-
+
return s1.compareToIgnoreCase( s2 );
}
}
@@ -889,10 +891,10 @@
{
MavenProject p1 = (MavenProject) o1;
MavenProject p2 = (MavenProject) o2;
-
+
return p1.getArtifact().compareTo( p2.getArtifact() );
}
-
+
public boolean equals( Object o1, Object o2 )
{
MavenProject p1 = (MavenProject) o1;
Modified: maven/plugins/trunk/maven-remote-resources-plugin/src/main/mdo/remote-resources.mdo
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-remote-resources-plugin/src/main/mdo/remote-resources.mdo?rev=611471&r1=611470&r2=611471&view=diff
==============================================================================
--- maven/plugins/trunk/maven-remote-resources-plugin/src/main/mdo/remote-resources.mdo (original)
+++ maven/plugins/trunk/maven-remote-resources-plugin/src/main/mdo/remote-resources.mdo Sat Jan 12 12:03:16 2008
@@ -21,8 +21,8 @@
<id>remoteResourcesBundle</id>
<name>RemoteResourcesBundle</name>
<description><![CDATA[
- Project-local overrides to the build process based on detected or user-provided environmental parameters.
- This is the model specification for ${basedir}/profiles.xml.
+ A bundle of remote resources.
+ This is the model specification for remote-resources.xml.
]]></description>
<defaults>
<default>
Modified: maven/plugins/trunk/maven-remote-resources-plugin/src/main/mdo/supplemental-model.mdo
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-remote-resources-plugin/src/main/mdo/supplemental-model.mdo?rev=611471&r1=611470&r2=611471&view=diff
==============================================================================
--- maven/plugins/trunk/maven-remote-resources-plugin/src/main/mdo/supplemental-model.mdo (original)
+++ maven/plugins/trunk/maven-remote-resources-plugin/src/main/mdo/supplemental-model.mdo Sat Jan 12 12:03:16 2008
@@ -36,7 +36,7 @@
<field xml.listStyle="flat">
<name>supplement</name>
<version>1.0.0</version>
- <description>Snippits of POM xml files used to supplement the data model.</description>
+ <description>Snippets of POM xml files used to supplement the data model.</description>
<association>
<type>Supplement</type>
<multiplicity>*</multiplicity>
@@ -52,10 +52,10 @@
<field>
<name>project</name>
<version>1.0.0</version>
- <description>Snippits of POM xml files used to supplement the data model.</description>
+ <description>Snippets of POM xml files used to supplement the data model.</description>
<type>DOM</type>
</field>
- </fields>
+ </fields>
</class>
</classes>
</model>
Modified: maven/plugins/trunk/maven-remote-resources-plugin/src/site/apt/index.apt
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-remote-resources-plugin/src/site/apt/index.apt?rev=611471&r1=611470&r2=611471&view=diff
==============================================================================
--- maven/plugins/trunk/maven-remote-resources-plugin/src/site/apt/index.apt (original)
+++ maven/plugins/trunk/maven-remote-resources-plugin/src/site/apt/index.apt Sat Jan 12 12:03:16 2008
@@ -35,12 +35,13 @@
* Goals Overview
* {{{bundle-mojo.html}remote-resources:bundle}} creates the resource bundle manifest required
- by the remote resource bundle processing. The manifest file,
- <<<${basedir}/target/classes/META-INF/maven/remote-resources.xml>>>, is created from the contents of the
+ by the remote resource bundle processing. The manifest file,
+ <<<${basedir}/target/classes/META-INF/maven/remote-resources.xml>>>, is created from the contents of the
<<<src/main/resources>>> directory.
-
+
* {{{process-mojo.html}remote-resources:process}} retrieves the specified
- remote resource bundles, processes them and places them in your <<<${basedir}/target/classes>>> directory.
+ remote resource bundles, processes them and makes them available to the
+ process-resources phase.
[]
Modified: maven/plugins/trunk/maven-remote-resources-plugin/src/site/fml/faq.fml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-remote-resources-plugin/src/site/fml/faq.fml?rev=611471&r1=611470&r2=611471&view=diff
==============================================================================
--- maven/plugins/trunk/maven-remote-resources-plugin/src/site/fml/faq.fml (original)
+++ maven/plugins/trunk/maven-remote-resources-plugin/src/site/fml/faq.fml Sat Jan 12 12:03:16 2008
@@ -28,7 +28,7 @@
a large set of projects, or an entire organization. Any project can specify the use of a
remote resource bundle and have the resources incorporated into their packaging. This means
that you can create standard settings in a parent POM somewhere in the project hierarchy and
- have all projects use package common resources in a standard way like licenses, other legal
+ have all projects use packaged common resources in a standard way like licenses, other legal
notices and disclaimers, or anything else that may be common.
</p>
</answer>
@@ -42,7 +42,7 @@
<ol>
<li>
File bugs with the projects that produced those artifacts to get them to fix them. Also,
- file bugs with the
+ file bugs with the
<a href="http://jira.codehaus.org/browse/MEV">Maven Evangelism</a>
project to have the Maven people enhance the metadata in the repository.
</li>
@@ -70,7 +70,8 @@
</supplement>
</supplementalDataModels>
</source>
- That location for that file can then be configured into the supplementalModels configuration for the process mojo. The
+ That location for that file can then be configured in the
+ <code>supplementalModels</code> configuration element for the process mojo. The
supplemental information is merged into the information provided from the repository.
</li>
</ol>