From e1f58d5f3dfd45ff407d3dc9ebaeeafb4bf2b6e5 Mon Sep 17 00:00:00 2001 From: Benjamin Bentmann Date: Thu, 14 Jan 2010 00:09:12 +0000 Subject: [PATCH] [MNG-4528] [regression] mvn deploy ignores proxy settings git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@899004 13f79535-47bb-0310-9956-ffa450edef68 --- .../plugin/internal/DefaultMavenPluginManager.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultMavenPluginManager.java b/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultMavenPluginManager.java index fcc850b0f2..5b54d76d97 100644 --- a/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultMavenPluginManager.java +++ b/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultMavenPluginManager.java @@ -47,6 +47,7 @@ import org.apache.maven.artifact.resolver.ArtifactResolutionResult; import org.apache.maven.artifact.resolver.ResolutionErrorHandler; import org.apache.maven.artifact.resolver.filter.AndArtifactFilter; import org.apache.maven.artifact.resolver.filter.ArtifactFilter; +import org.apache.maven.artifact.resolver.filter.ExclusionSetFilter; import org.apache.maven.artifact.resolver.filter.ScopeArtifactFilter; import org.apache.maven.classrealm.ClassRealmManager; import org.apache.maven.execution.MavenSession; @@ -441,6 +442,19 @@ public class DefaultMavenPluginManager ArtifactFilter collectionFilter = new ScopeArtifactFilter( Artifact.SCOPE_RUNTIME_PLUS_SYSTEM ); + /* + * NOTE: This is a hack to support maven-deploy-plugin:[2.2.1,2.4] which has dependencies on old/buggy wagons. + * Under our class loader hierarchy those would take precedence over the wagons from the distro, causing grief + * due to their bugs (e.g. MNG-4528). + */ + if ( "maven-deploy-plugin".equals( plugin.getArtifactId() ) + && "org.apache.maven.plugins".equals( plugin.getGroupId() ) ) + { + collectionFilter = + new AndArtifactFilter( Arrays.asList( collectionFilter, + new ExclusionSetFilter( new String[] { "maven-core" } ) ) ); + } + ArtifactFilter resolutionFilter = artifactFilterManager.getCoreArtifactFilter(); if ( dependencyFilter != null )