You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by jd...@apache.org on 2009/09/11 19:01:23 UTC
svn commit: r813922 - in /maven/plugins/trunk/maven-remote-resources-plugin:
./ src/it/resources/run-only-at-execution-root/
src/it/resources/run-only-at-execution-root/child1/
src/it/resources/run-only-at-execution-root/child2/
src/it/resources/run-on...
Author: jdcasey
Date: Fri Sep 11 17:01:22 2009
New Revision: 813922
URL: http://svn.apache.org/viewvc?rev=813922&view=rev
Log:
[MRRESOURCES-41] Adding IT for runOnlyAtExecutionRoot.
Added:
maven/plugins/trunk/maven-remote-resources-plugin/src/it/resources/run-only-at-execution-root/
maven/plugins/trunk/maven-remote-resources-plugin/src/it/resources/run-only-at-execution-root/child1/
maven/plugins/trunk/maven-remote-resources-plugin/src/it/resources/run-only-at-execution-root/child1/pom.xml (with props)
maven/plugins/trunk/maven-remote-resources-plugin/src/it/resources/run-only-at-execution-root/child2/
maven/plugins/trunk/maven-remote-resources-plugin/src/it/resources/run-only-at-execution-root/child2/pom.xml (with props)
maven/plugins/trunk/maven-remote-resources-plugin/src/it/resources/run-only-at-execution-root/pom.xml (with props)
maven/plugins/trunk/maven-remote-resources-plugin/src/it/resources/run-only-at-execution-root/resource-projects/
maven/plugins/trunk/maven-remote-resources-plugin/src/it/resources/run-only-at-execution-root/resource-projects/pom.xml (with props)
maven/plugins/trunk/maven-remote-resources-plugin/src/it/resources/run-only-at-execution-root/resource-projects/release/
maven/plugins/trunk/maven-remote-resources-plugin/src/it/resources/run-only-at-execution-root/resource-projects/release/pom.xml (with props)
maven/plugins/trunk/maven-remote-resources-plugin/src/it/resources/run-only-at-execution-root/resource-projects/release/src/
maven/plugins/trunk/maven-remote-resources-plugin/src/it/resources/run-only-at-execution-root/resource-projects/release/src/main/
maven/plugins/trunk/maven-remote-resources-plugin/src/it/resources/run-only-at-execution-root/resource-projects/release/src/main/resources/
maven/plugins/trunk/maven-remote-resources-plugin/src/it/resources/run-only-at-execution-root/resource-projects/release/src/main/resources/some.properties (with props)
maven/plugins/trunk/maven-remote-resources-plugin/src/it/resources/run-only-at-execution-root/resource-projects/snapshot/
maven/plugins/trunk/maven-remote-resources-plugin/src/it/resources/run-only-at-execution-root/resource-projects/snapshot/pom.xml (with props)
maven/plugins/trunk/maven-remote-resources-plugin/src/it/resources/run-only-at-execution-root/resource-projects/snapshot/src/
maven/plugins/trunk/maven-remote-resources-plugin/src/it/resources/run-only-at-execution-root/resource-projects/snapshot/src/main/
maven/plugins/trunk/maven-remote-resources-plugin/src/it/resources/run-only-at-execution-root/resource-projects/snapshot/src/main/resources/
maven/plugins/trunk/maven-remote-resources-plugin/src/it/resources/run-only-at-execution-root/resource-projects/snapshot/src/main/resources/some.properties (with props)
maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_GetDependencyProjects.java (with props)
maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_RunOnlyAtExecutionRoot.java (with props)
Removed:
maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_GetDependenyProjects.java
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
maven/plugins/trunk/maven-remote-resources-plugin/src/site/apt/usage.apt.vm
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?rev=813922&r1=813921&r2=813922&view=diff
==============================================================================
--- maven/plugins/trunk/maven-remote-resources-plugin/pom.xml (original)
+++ maven/plugins/trunk/maven-remote-resources-plugin/pom.xml Fri Sep 11 17:01:22 2009
@@ -140,7 +140,7 @@
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-resources</artifactId>
- <version>1.0-alpha-5-SNAPSHOT</version>
+ <version>1.0-alpha-5</version>
</dependency>
<dependency>
<groupId>junit</groupId>
Added: maven/plugins/trunk/maven-remote-resources-plugin/src/it/resources/run-only-at-execution-root/child1/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-remote-resources-plugin/src/it/resources/run-only-at-execution-root/child1/pom.xml?rev=813922&view=auto
==============================================================================
--- maven/plugins/trunk/maven-remote-resources-plugin/src/it/resources/run-only-at-execution-root/child1/pom.xml (added)
+++ maven/plugins/trunk/maven-remote-resources-plugin/src/it/resources/run-only-at-execution-root/child1/pom.xml Fri Sep 11 17:01:22 2009
@@ -0,0 +1,20 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.maven.plugin.rresource.it.mrr41</groupId>
+ <artifactId>parent</artifactId>
+ <version>${project.version}</version>
+ </parent>
+
+ <artifactId>child-1</artifactId>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.maven.plugin.rresource.it.mrr41</groupId>
+ <artifactId>release</artifactId>
+ <version>1.0</version>
+ </dependency>
+ </dependencies>
+</project>
Propchange: maven/plugins/trunk/maven-remote-resources-plugin/src/it/resources/run-only-at-execution-root/child1/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: maven/plugins/trunk/maven-remote-resources-plugin/src/it/resources/run-only-at-execution-root/child2/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-remote-resources-plugin/src/it/resources/run-only-at-execution-root/child2/pom.xml?rev=813922&view=auto
==============================================================================
--- maven/plugins/trunk/maven-remote-resources-plugin/src/it/resources/run-only-at-execution-root/child2/pom.xml (added)
+++ maven/plugins/trunk/maven-remote-resources-plugin/src/it/resources/run-only-at-execution-root/child2/pom.xml Fri Sep 11 17:01:22 2009
@@ -0,0 +1,20 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.maven.plugin.rresource.it.mrr41</groupId>
+ <artifactId>parent</artifactId>
+ <version>${project.version}</version>
+ </parent>
+
+ <artifactId>child-2</artifactId>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.maven.plugin.rresource.it.mrr41</groupId>
+ <artifactId>snapshot</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </dependency>
+ </dependencies>
+</project>
Propchange: maven/plugins/trunk/maven-remote-resources-plugin/src/it/resources/run-only-at-execution-root/child2/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: maven/plugins/trunk/maven-remote-resources-plugin/src/it/resources/run-only-at-execution-root/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-remote-resources-plugin/src/it/resources/run-only-at-execution-root/pom.xml?rev=813922&view=auto
==============================================================================
--- maven/plugins/trunk/maven-remote-resources-plugin/src/it/resources/run-only-at-execution-root/pom.xml (added)
+++ maven/plugins/trunk/maven-remote-resources-plugin/src/it/resources/run-only-at-execution-root/pom.xml Fri Sep 11 17:01:22 2009
@@ -0,0 +1,62 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.apache.maven.plugin.rresource.it.mrr41</groupId>
+ <artifactId>parent</artifactId>
+ <version>${project.version}</version>
+
+ <packaging>pom</packaging>
+
+ <modules>
+ <module>child1</module>
+ <module>child2</module>
+ </modules>
+
+ <repositories>
+ <repository>
+ <id>it-remote</id>
+ <url>file:${remoteRepository}</url>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ </repository>
+ <repository>
+ <id>main-local</id>
+ <url>file:${localRepository}</url>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ </repository>
+ </repositories>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-remote-resources-plugin</artifactId>
+ <version>${project.version}</version>
+ <executions>
+ <execution>
+ <id>remote-resources</id>
+ <goals>
+ <goal>process</goal>
+ </goals>
+ <configuration>
+ <runOnlyAtExecutionRoot>true</runOnlyAtExecutionRoot>
+ <resourceBundles>
+ <resourceBundle>org.apache.maven.plugin.rresource.it:resource-bundle-with-template:${project.version}</resourceBundle>
+ </resourceBundles>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
Propchange: maven/plugins/trunk/maven-remote-resources-plugin/src/it/resources/run-only-at-execution-root/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: maven/plugins/trunk/maven-remote-resources-plugin/src/it/resources/run-only-at-execution-root/resource-projects/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-remote-resources-plugin/src/it/resources/run-only-at-execution-root/resource-projects/pom.xml?rev=813922&view=auto
==============================================================================
--- maven/plugins/trunk/maven-remote-resources-plugin/src/it/resources/run-only-at-execution-root/resource-projects/pom.xml (added)
+++ maven/plugins/trunk/maven-remote-resources-plugin/src/it/resources/run-only-at-execution-root/resource-projects/pom.xml Fri Sep 11 17:01:22 2009
@@ -0,0 +1,21 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.apache.maven.plugin.rresource.it.mrr41</groupId>
+ <artifactId>aggregator</artifactId>
+ <version>1.0</version>
+ <packaging>pom</packaging>
+
+ <modules>
+ <module>release</module>
+ <module>snapshot</module>
+ </modules>
+
+ <distributionManagement>
+ <repository>
+ <id>it-remote</id>
+ <url>file:${remoteRepository}</url>
+ </repository>
+ </distributionManagement>
+</project>
Propchange: maven/plugins/trunk/maven-remote-resources-plugin/src/it/resources/run-only-at-execution-root/resource-projects/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: maven/plugins/trunk/maven-remote-resources-plugin/src/it/resources/run-only-at-execution-root/resource-projects/release/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-remote-resources-plugin/src/it/resources/run-only-at-execution-root/resource-projects/release/pom.xml?rev=813922&view=auto
==============================================================================
--- maven/plugins/trunk/maven-remote-resources-plugin/src/it/resources/run-only-at-execution-root/resource-projects/release/pom.xml (added)
+++ maven/plugins/trunk/maven-remote-resources-plugin/src/it/resources/run-only-at-execution-root/resource-projects/release/pom.xml Fri Sep 11 17:01:22 2009
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<project>
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.apache.maven.plugin.rresource.it.mrr41</groupId>
+ <artifactId>release</artifactId>
+ <!-- NOTE: This has to be a non-snapshot version -->
+ <version>1.0</version>
+
+ <packaging>jar</packaging>
+
+ <name>Released Dependency</name>
+
+ <repositories>
+ <repository>
+ <id>main-local</id>
+ <url>file:${localRepository}</url>
+ </repository>
+ </repositories>
+
+ <distributionManagement>
+ <repository>
+ <id>it-remote</id>
+ <url>file:${remoteRepository}</url>
+ </repository>
+ </distributionManagement>
+
+</project>
Propchange: maven/plugins/trunk/maven-remote-resources-plugin/src/it/resources/run-only-at-execution-root/resource-projects/release/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: maven/plugins/trunk/maven-remote-resources-plugin/src/it/resources/run-only-at-execution-root/resource-projects/release/src/main/resources/some.properties
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-remote-resources-plugin/src/it/resources/run-only-at-execution-root/resource-projects/release/src/main/resources/some.properties?rev=813922&view=auto
==============================================================================
--- maven/plugins/trunk/maven-remote-resources-plugin/src/it/resources/run-only-at-execution-root/resource-projects/release/src/main/resources/some.properties (added)
+++ maven/plugins/trunk/maven-remote-resources-plugin/src/it/resources/run-only-at-execution-root/resource-projects/release/src/main/resources/some.properties Fri Sep 11 17:01:22 2009
@@ -0,0 +1 @@
+# just to make the project's JAR isn't empty
Propchange: maven/plugins/trunk/maven-remote-resources-plugin/src/it/resources/run-only-at-execution-root/resource-projects/release/src/main/resources/some.properties
------------------------------------------------------------------------------
svn:eol-style = native
Added: maven/plugins/trunk/maven-remote-resources-plugin/src/it/resources/run-only-at-execution-root/resource-projects/snapshot/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-remote-resources-plugin/src/it/resources/run-only-at-execution-root/resource-projects/snapshot/pom.xml?rev=813922&view=auto
==============================================================================
--- maven/plugins/trunk/maven-remote-resources-plugin/src/it/resources/run-only-at-execution-root/resource-projects/snapshot/pom.xml (added)
+++ maven/plugins/trunk/maven-remote-resources-plugin/src/it/resources/run-only-at-execution-root/resource-projects/snapshot/pom.xml Fri Sep 11 17:01:22 2009
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<project>
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.apache.maven.plugin.rresource.it.mrr41</groupId>
+ <artifactId>snapshot</artifactId>
+ <!-- NOTE: This has to be a snapshot version -->
+ <version>1.0-SNAPSHOT</version>
+
+ <packaging>jar</packaging>
+
+ <name>Snapshot Dependency</name>
+
+ <repositories>
+ <repository>
+ <id>main-local</id>
+ <url>file:${localRepository}</url>
+ </repository>
+ </repositories>
+
+ <distributionManagement>
+ <repository>
+ <id>it-remote</id>
+ <url>file:${remoteRepository}</url>
+ </repository>
+ </distributionManagement>
+
+</project>
Propchange: maven/plugins/trunk/maven-remote-resources-plugin/src/it/resources/run-only-at-execution-root/resource-projects/snapshot/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: maven/plugins/trunk/maven-remote-resources-plugin/src/it/resources/run-only-at-execution-root/resource-projects/snapshot/src/main/resources/some.properties
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-remote-resources-plugin/src/it/resources/run-only-at-execution-root/resource-projects/snapshot/src/main/resources/some.properties?rev=813922&view=auto
==============================================================================
--- maven/plugins/trunk/maven-remote-resources-plugin/src/it/resources/run-only-at-execution-root/resource-projects/snapshot/src/main/resources/some.properties (added)
+++ maven/plugins/trunk/maven-remote-resources-plugin/src/it/resources/run-only-at-execution-root/resource-projects/snapshot/src/main/resources/some.properties Fri Sep 11 17:01:22 2009
@@ -0,0 +1 @@
+# just to make the project's JAR isn't empty
Propchange: maven/plugins/trunk/maven-remote-resources-plugin/src/it/resources/run-only-at-execution-root/resource-projects/snapshot/src/main/resources/some.properties
------------------------------------------------------------------------------
svn:eol-style = native
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=813922&r1=813921&r2=813922&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 Fri Sep 11 17:01:22 2009
@@ -33,6 +33,7 @@
import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.logging.Log;
import org.apache.maven.plugin.resources.remote.io.xpp3.RemoteResourcesBundleXpp3Reader;
import org.apache.maven.plugin.resources.remote.io.xpp3.SupplementalDataModelXpp3Reader;
import org.apache.maven.project.InvalidProjectModelException;
@@ -165,6 +166,15 @@
protected boolean runOnlyAtExecutionRoot;
/**
+ * Used for calculation of execution-root for {@link ProcessRemoteResourcesMojo#runOnlyAtExecutionRoot}.
+ *
+ * @parameter default-value="${basedir}"
+ * @readonly
+ * @required
+ */
+ protected File basedir;
+
+ /**
* The character encoding scheme to be applied when filtering resources.
*
* @parameter expression="${encoding}" default-value="${project.build.sourceEncoding}"
@@ -433,6 +443,13 @@
{
return;
}
+
+ if ( runOnlyAtExecutionRoot && !isExecutionRoot() )
+ {
+ getLog().info( "Skipping remote-resource generation in this project because it's not the Execution Root" );
+ return;
+ }
+
if ( supplementalModels == null )
{
File sups = new File( appendedResourcesDirectory, "supplemental-models.xml" );
@@ -516,6 +533,30 @@
}
}
+ private boolean isExecutionRoot()
+ {
+ Log log = this.getLog();
+
+ boolean result = mavenSession.getExecutionRootDirectory().equalsIgnoreCase( basedir.toString() );
+
+ if ( log.isDebugEnabled() )
+ {
+ log.debug("Root Folder:" + mavenSession.getExecutionRootDirectory());
+ log.debug("Current Folder:"+ basedir );
+
+ if ( result )
+ {
+ log.debug( "This is the execution root." );
+ }
+ else
+ {
+ log.debug( "This is NOT the execution root." );
+ }
+ }
+
+ return result;
+ }
+
private void addSupplementalModelArtifacts() throws MojoExecutionException
{
if ( supplementalModelArtifacts != null && !supplementalModelArtifacts.isEmpty() )
Modified: maven/plugins/trunk/maven-remote-resources-plugin/src/site/apt/usage.apt.vm
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-remote-resources-plugin/src/site/apt/usage.apt.vm?rev=813922&r1=813921&r2=813922&view=diff
==============================================================================
--- maven/plugins/trunk/maven-remote-resources-plugin/src/site/apt/usage.apt.vm (original)
+++ maven/plugins/trunk/maven-remote-resources-plugin/src/site/apt/usage.apt.vm Fri Sep 11 17:01:22 2009
@@ -2,6 +2,7 @@
Usage
------
Jason van Zyl
+ John Casey
------
27 November 2006
------
@@ -25,6 +26,41 @@
Usage
+* Multi-Module Builds <since: 1.1>
+
+ In many cases, an application build consists of multiple Maven modules, but you only need to
+ include the license files, dependencies listing, etc. once for the entire application. Of course,
+ in such cases, the dependencies listing needs to aggregate all dependencies of all modules.
+
+ To accomplish this, you can use the new <<<runOnlyAtExecutionRoot>>> parameter when you configure
+ the Remote-Resources plugin in your application parent POM. This parameter limits execution of the
+ Remote-Resources plugin to the root directory in which the build was run. In most cases, the
+ application's distribution archives will be created at this top directory, so this is a natural
+ location into which licensing and dependency information should be generated.
+
+ To run the Remote-Resources plugin only in the execution root, use the following:
+
++---+
+ <plugin>
+ <artifactId>maven-remote-resources-plugin</artifactId>
+ <version>${project.version}</version>
+ [...]
+
+ <executions>
+ <execution>
+ <id>process-remote-resources</id>
+ <goals>
+ <goal>process</goal>
+ </goals>
+ <configuration>
+ <runOnlyAtExecutionRoot>true</runOnlyAtExecutionRoot>
+ [...]
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
++---+
+
* How to Create a Resource Bundle
To turn on the bundle resource manifest generation you need to configure the plugin as follows:
@@ -89,4 +125,4 @@
This will retrieve the <<<apache-jar-resource-bundle-1.0.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
+ <<<${basedir}/target/classes>>> directory.
Added: maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_GetDependencyProjects.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_GetDependencyProjects.java?rev=813922&view=auto
==============================================================================
--- maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_GetDependencyProjects.java (added)
+++ maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_GetDependencyProjects.java Fri Sep 11 17:01:22 2009
@@ -0,0 +1,65 @@
+package org.apache.maven.plugin.resources.remote.it;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.maven.it.VerificationException;
+import org.apache.maven.it.Verifier;
+import org.apache.maven.plugin.resources.remote.it.support.TestUtils;
+import org.codehaus.plexus.util.FileUtils;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.URISyntaxException;
+
+/**
+ * @author Benjamin Bentmann
+ */
+public class IT_GetDependencyProjects
+ extends AbstractIT
+{
+
+ public void test()
+ throws IOException, URISyntaxException, VerificationException
+ {
+ File dir = TestUtils.getTestDir( "get-dependency-projects" );
+
+ Verifier verifier;
+
+ verifier = new Verifier( dir.getAbsolutePath() );
+ verifier.executeGoal( "deploy" );
+ verifier.verifyErrorFreeLog();
+ verifier.resetStreams();
+
+ verifier = new Verifier( new File( dir, "project" ).getAbsolutePath() );
+
+ verifier.deleteArtifacts( "org.apache.maven.plugin.rresource.it.gdp" );
+
+ verifier.executeGoal( "generate-resources" );
+ verifier.verifyErrorFreeLog();
+ verifier.resetStreams();
+
+ File output = new File( dir, "project/target/maven-shared-archive-resources/DEPENDENCIES" );
+ String content = FileUtils.fileRead( output );
+
+ assertTrue( content.indexOf( "Dependency Id: org.apache.maven.plugin.rresource.it.gdp:release:1.0" ) >= 0 );
+ assertTrue( content.indexOf( "Dependency Id: org.apache.maven.plugin.rresource.it.gdp:snapshot:1.0-SNAPSHOT" ) >= 0 );
+ }
+
+}
Propchange: maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_GetDependencyProjects.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_RunOnlyAtExecutionRoot.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_RunOnlyAtExecutionRoot.java?rev=813922&view=auto
==============================================================================
--- maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_RunOnlyAtExecutionRoot.java (added)
+++ maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_RunOnlyAtExecutionRoot.java Fri Sep 11 17:01:22 2009
@@ -0,0 +1,71 @@
+package org.apache.maven.plugin.resources.remote.it;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.maven.it.VerificationException;
+import org.apache.maven.it.Verifier;
+import org.apache.maven.plugin.resources.remote.it.support.TestUtils;
+import org.codehaus.plexus.util.FileUtils;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.URISyntaxException;
+
+/**
+ * @author Benjamin Bentmann
+ */
+public class IT_RunOnlyAtExecutionRoot
+ extends AbstractIT
+{
+
+ public void test()
+ throws IOException, URISyntaxException, VerificationException
+ {
+ File dir = TestUtils.getTestDir( "run-only-at-execution-root" );
+
+ Verifier verifier;
+
+ verifier = new Verifier( new File( dir, "resource-projects" ).getAbsolutePath() );
+ verifier.executeGoal( "deploy" );
+ verifier.verifyErrorFreeLog();
+ verifier.resetStreams();
+
+ verifier = new Verifier( dir.getAbsolutePath() );
+
+ verifier.deleteArtifacts( "org.apache.maven.plugin.rresource.it.mrr41" );
+
+ verifier.executeGoal( "generate-resources" );
+ verifier.verifyErrorFreeLog();
+ verifier.resetStreams();
+
+ String depResource = "target/maven-shared-archive-resources/DEPENDENCIES";
+ File output = new File( dir, depResource );
+ assertTrue( output.exists() );
+
+ assertFalse( new File( dir, "child1/" + depResource ).exists() );
+ assertFalse( new File( dir, "child2/" + depResource ).exists() );
+
+ String content = FileUtils.fileRead( output );
+
+ assertTrue( content.indexOf( "Dependency Id: org.apache.maven.plugin.rresource.it.mrr41:release:1.0" ) >= 0 );
+ assertTrue( content.indexOf( "Dependency Id: org.apache.maven.plugin.rresource.it.mrr41:snapshot:1.0-SNAPSHOT" ) >= 0 );
+ }
+
+}
Propchange: maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_RunOnlyAtExecutionRoot.java
------------------------------------------------------------------------------
svn:eol-style = native