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 22:36:22 UTC
svn commit: r814018 - in /maven/plugins/trunk/maven-remote-resources-plugin:
pom.xml src/it/resources/run-only-at-execution-root/child2/pom.xml
src/main/java/org/apache/maven/plugin/resources/remote/ProcessRemoteResourcesMojo.java
Author: jdcasey
Date: Fri Sep 11 20:36:19 2009
New Revision: 814018
URL: http://svn.apache.org/viewvc?rev=814018&view=rev
Log:
[MRRESOURCES-41] Adding project interdependency to make sure it doesn't fail the build if two child projects depend on one another and we're resolving from the topmost level only.
Modified:
maven/plugins/trunk/maven-remote-resources-plugin/pom.xml
maven/plugins/trunk/maven-remote-resources-plugin/src/it/resources/run-only-at-execution-root/child2/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?rev=814018&r1=814017&r2=814018&view=diff
==============================================================================
--- maven/plugins/trunk/maven-remote-resources-plugin/pom.xml (original)
+++ maven/plugins/trunk/maven-remote-resources-plugin/pom.xml Fri Sep 11 20:36:19 2009
@@ -178,6 +178,14 @@
<pluginManagement>
<plugins>
<plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>2.0.2</version>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ <plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.4.3</version>
<configuration>
Modified: 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=814018&r1=814017&r2=814018&view=diff
==============================================================================
--- maven/plugins/trunk/maven-remote-resources-plugin/src/it/resources/run-only-at-execution-root/child2/pom.xml (original)
+++ maven/plugins/trunk/maven-remote-resources-plugin/src/it/resources/run-only-at-execution-root/child2/pom.xml Fri Sep 11 20:36:19 2009
@@ -13,6 +13,11 @@
<dependencies>
<dependency>
<groupId>org.apache.maven.plugin.rresource.it.mrr41</groupId>
+ <artifactId>child-1</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven.plugin.rresource.it.mrr41</groupId>
<artifactId>snapshot</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
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=814018&r1=814017&r2=814018&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 20:36:19 2009
@@ -117,9 +117,10 @@
* </p>
*
* @goal process
- * @requiresDependencyResolution test
* @phase generate-resources
*/
+// NOTE: Removed the following in favor of maven-artifact-resolver library, for MRRESOURCES-41
+// @requiresDependencyResolution test
public class ProcessRemoteResourcesMojo
extends AbstractMojo
{
@@ -598,16 +599,14 @@
FilterArtifacts filter = new FilterArtifacts();
Set depArtifacts;
- Set artifacts;
+ Set artifacts = resolveProjectArtifacts();
if ( runOnlyAtExecutionRoot )
{
depArtifacts = aggregateProjectDependencyArtifacts();
- artifacts = resolveProjectArtifacts();
}
else
{
depArtifacts = project.getDependencyArtifacts();
- artifacts = project.getArtifacts();
}
filter.addFilter( new TransitivityFilter( depArtifacts, this.excludeTransitive ) );
@@ -686,11 +685,17 @@
private Set resolveProjectArtifacts()
throws MojoExecutionException
{
- List projects = mavenSession.getSortedProjects();
-
try
{
- return dependencyResolver.resolve( projects, Collections.singleton( Artifact.SCOPE_TEST ), mavenSession );
+ if ( runOnlyAtExecutionRoot )
+ {
+ List projects = mavenSession.getSortedProjects();
+ return dependencyResolver.resolve( projects, Collections.singleton( Artifact.SCOPE_TEST ), mavenSession );
+ }
+ else
+ {
+ return dependencyResolver.resolve( project, Collections.singleton( Artifact.SCOPE_TEST ), mavenSession );
+ }
}
catch ( ArtifactResolutionException e )
{