maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdca...@apache.org
Subject svn commit: r433789 - /maven/components/trunk/maven-core/src/main/java/org/apache/maven/extension/DefaultExtensionManager.java
Date Tue, 22 Aug 2006 22:54:15 GMT
Author: jdcasey
Date: Tue Aug 22 15:54:13 2006
New Revision: 433789

URL: http://svn.apache.org/viewvc?rev=433789&view=rev
Log:
Merged from 433788 on the branch, to fix the case where build extensions don't get resolved
when building projects that would be filtered by Maven's core artifact filter...as in the
case of some plexus projects, and of maven projects themselves.

Modified:
    maven/components/trunk/maven-core/src/main/java/org/apache/maven/extension/DefaultExtensionManager.java

Modified: maven/components/trunk/maven-core/src/main/java/org/apache/maven/extension/DefaultExtensionManager.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-core/src/main/java/org/apache/maven/extension/DefaultExtensionManager.java?rev=433789&r1=433788&r2=433789&view=diff
==============================================================================
--- maven/components/trunk/maven-core/src/main/java/org/apache/maven/extension/DefaultExtensionManager.java
(original)
+++ maven/components/trunk/maven-core/src/main/java/org/apache/maven/extension/DefaultExtensionManager.java
Tue Aug 22 15:54:13 2006
@@ -65,12 +65,14 @@
 
         if ( artifact != null )
         {
+        		ArtifactFilter filter = new ProjectArtifactExceptionFilter( artifactFilter, project.getArtifact()
);
+        		
             ArtifactResolutionResult result = artifactResolver.resolveTransitively( Collections.singleton(
artifact ),
                                                                                     project.getArtifact(),
                                                                                     localRepository,
                                                                                     project.getRemoteArtifactRepositories(),
                                                                                     artifactMetadataSource,
-                                                                                    artifactFilter
);
+                                                                                    filter
);
             for ( Iterator i = result.getArtifacts().iterator(); i.hasNext(); )
             {
                 Artifact a = (Artifact) i.next();
@@ -86,5 +88,24 @@
         throws ContextException
     {
         this.container = (PlexusContainer) context.get( PlexusConstants.PLEXUS_KEY );
+    }
+    
+    private static final class ProjectArtifactExceptionFilter implements ArtifactFilter
+    {
+    		private ArtifactFilter passThroughFilter;
+    		private String projectDependencyConflictId;
+    		
+    		ProjectArtifactExceptionFilter( ArtifactFilter passThroughFilter, Artifact projectArtifact
)
+    		{
+				this.passThroughFilter = passThroughFilter;
+				this.projectDependencyConflictId = projectArtifact.getDependencyConflictId();
+    		}
+
+		public boolean include(Artifact artifact) {
+			String depConflictId = artifact.getDependencyConflictId();
+			
+			return projectDependencyConflictId.equals( depConflictId )
+					|| passThroughFilter.include( artifact );
+		}
     }
 }



Mime
View raw message