maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdca...@apache.org
Subject svn commit: r736547 - in /maven/components/branches/maven-2.1.x: ./ apache-maven/ apache-maven/src/test/ maven-artifact/src/main/java/org/apache/maven/artifact/resolver/ maven-integration-tests/ maven-model/src/test/ maven-project/src/main/java/org/apa...
Date Thu, 22 Jan 2009 03:57:09 GMT
Author: jdcasey
Date: Wed Jan 21 19:57:09 2009
New Revision: 736547

URL: http://svn.apache.org/viewvc?rev=736547&view=rev
Log:
[MNG-3769] Merging fix for exclusions based on post-relocation artifact details over from
maven-2.0.x branch.

Modified:
    maven/components/branches/maven-2.1.x/   (props changed)
    maven/components/branches/maven-2.1.x/apache-maven/   (props changed)
    maven/components/branches/maven-2.1.x/apache-maven/src/test/   (props changed)
    maven/components/branches/maven-2.1.x/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactCollector.java
    maven/components/branches/maven-2.1.x/maven-integration-tests/   (props changed)
    maven/components/branches/maven-2.1.x/maven-model/src/test/   (props changed)
    maven/components/branches/maven-2.1.x/maven-project/src/main/java/org/apache/maven/project/artifact/MavenMetadataSource.java

Propchange: maven/components/branches/maven-2.1.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Jan 21 19:57:09 2009
@@ -1,5 +1,5 @@
 /maven/components/branches/maven-2.0.10-RC:679193-679867,680477-688882,708790-728809,728834
-/maven/components/branches/maven-2.0.x:679552-679867,693956-728820,728836,728940,729060,729738,729785,730461,730631,734502,734803
+/maven/components/branches/maven-2.0.x:679552-679867,693956-728820,728836,728940,729060,729738,729785,730461,730631,734502,734803,736543
 /maven/components/branches/maven-2.1.0-M1-RC:690315,691793-694304
 /maven/components/branches/maven-2.1.0-RC:688883,689695,689976,689990
 /maven/components/trunk:720001,721902,726845,729292

Propchange: maven/components/branches/maven-2.1.x/apache-maven/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Jan 21 19:57:09 2009
@@ -1,5 +1,5 @@
 /maven/components/branches/maven-2.0.10-RC/apache-maven:679193-679867,680477-688882,708790-728809,728834
-/maven/components/branches/maven-2.0.x/apache-maven:533160,636838,649903,657432,659677,679552-679867,693956-728820,728836,728940
+/maven/components/branches/maven-2.0.x/apache-maven:533160,636838,649903,657432,659677,679552-679867,693956-728820,728836,728940,736543
 /maven/components/branches/maven-2.1.0-M1-RC/apache-maven:690315,691793-694304
 /maven/components/branches/maven-2.1.0-RC/apache-maven:688883,689695,689976,689990
 /maven/components/trunk/apache-maven:720001,721902,726845,727688

Propchange: maven/components/branches/maven-2.1.x/apache-maven/src/test/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Jan 21 19:57:09 2009
@@ -1 +1,2 @@
 /maven/components/branches/maven-2.0.10-RC/apache-maven/src/test:728834
+/maven/components/branches/maven-2.0.x/apache-maven/src/test:736543

Modified: maven/components/branches/maven-2.1.x/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactCollector.java
URL: http://svn.apache.org/viewvc/maven/components/branches/maven-2.1.x/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactCollector.java?rev=736547&r1=736546&r2=736547&view=diff
==============================================================================
--- maven/components/branches/maven-2.1.x/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactCollector.java
(original)
+++ maven/components/branches/maven-2.1.x/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactCollector.java
Wed Jan 21 19:57:09 2009
@@ -285,6 +285,8 @@
         {
             fireEvent( ResolutionListener.PROCESS_CHILDREN, listeners, node );
 
+            Artifact parentArtifact = node.getArtifact();
+            
             for ( Iterator i = node.getChildrenIterator(); i.hasNext(); )
             {
                 ResolutionNode child = (ResolutionNode) i.next();
@@ -386,11 +388,22 @@
                             Artifact relocated = source.retrieveRelocatedArtifact( artifact,
localRepository, childRemoteRepositories );
                             if ( relocated != null && !artifact.equals( relocated
) )
                             {
+                                relocated.setDependencyFilter( artifact.getDependencyFilter()
);
                                 artifact = relocated;
                                 child.setArtifact( artifact );
                             }
                         }
                         while( !childKey.equals( child.getKey() ) );
+                        
+                        if ( parentArtifact != null && parentArtifact.getDependencyFilter()
!= null && !parentArtifact.getDependencyFilter().include( artifact ) )
+                        {
+                            // MNG-3769: the [probably relocated] artifact is excluded. 
+                            // We could process exclusions on relocated artifact details
in the
+                            // MavenMetadataSource.createArtifacts(..) step, BUT that would
+                            // require resolving the POM from the repository very early on
in
+                            // the build.
+                            continue;
+                        }
 
                         artifact.setDependencyTrail( node.getDependencyTrail() );
                         ResolutionGroup rGroup = source.retrieve( artifact, localRepository,
childRemoteRepositories );

Propchange: maven/components/branches/maven-2.1.x/maven-integration-tests/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Jan 21 19:57:09 2009
@@ -1 +1,2 @@
 /maven/components/branches/maven-2.0.10-RC/maven-integration-tests:728834
+/maven/components/branches/maven-2.0.x/maven-integration-tests:736543

Propchange: maven/components/branches/maven-2.1.x/maven-model/src/test/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Jan 21 19:57:09 2009
@@ -1 +1,2 @@
 /maven/components/branches/maven-2.0.10-RC/maven-model/src/test:728834
+/maven/components/branches/maven-2.0.x/maven-model/src/test:736543

Modified: maven/components/branches/maven-2.1.x/maven-project/src/main/java/org/apache/maven/project/artifact/MavenMetadataSource.java
URL: http://svn.apache.org/viewvc/maven/components/branches/maven-2.1.x/maven-project/src/main/java/org/apache/maven/project/artifact/MavenMetadataSource.java?rev=736547&r1=736546&r2=736547&view=diff
==============================================================================
--- maven/components/branches/maven-2.1.x/maven-project/src/main/java/org/apache/maven/project/artifact/MavenMetadataSource.java
(original)
+++ maven/components/branches/maven-2.1.x/maven-project/src/main/java/org/apache/maven/project/artifact/MavenMetadataSource.java
Wed Jan 21 19:57:09 2009
@@ -447,6 +447,11 @@
 
             ArtifactFilter artifactFilter = dependencyFilter;
 
+            // MNG-3769: It would be nice to be able to process relocations here, 
+            // so we could have this filtering step apply to post-relocated dependencies.
+            // HOWEVER, this would require a much more invasive POM resolution process
+            // in order to look for relocations, which would make the early steps in 
+            // a Maven build way too heavy.
             if ( artifact != null && ( artifactFilter == null || artifactFilter.include(
artifact ) ) )
             {
                 if ( d.getExclusions() != null && !d.getExclusions().isEmpty() )



Mime
View raw message