From 8ea9a241b64f5ae1f23d8bc5faa1864f2142447d Mon Sep 17 00:00:00 2001 From: Benjamin Bentmann Date: Thu, 5 Mar 2009 12:46:41 +0000 Subject: [PATCH] o Fixed missing propagation of authentication info to the wagon manager git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@750444 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/maven/artifact/manager/WagonManager.java | 12 ++++-------- .../repository/LegacyMavenRepositorySystem.java | 10 +++++++++- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/maven-compat/src/main/java/org/apache/maven/artifact/manager/WagonManager.java b/maven-compat/src/main/java/org/apache/maven/artifact/manager/WagonManager.java index 876853ceb2..9422d09122 100644 --- a/maven-compat/src/main/java/org/apache/maven/artifact/manager/WagonManager.java +++ b/maven-compat/src/main/java/org/apache/maven/artifact/manager/WagonManager.java @@ -26,19 +26,11 @@ import org.apache.maven.wagon.ResourceDoesNotExistException; import org.apache.maven.wagon.TransferFailedException; import org.apache.maven.wagon.UnsupportedProtocolException; import org.apache.maven.wagon.Wagon; -import org.apache.maven.wagon.authentication.AuthenticationInfo; import org.apache.maven.wagon.events.TransferListener; -import org.apache.maven.wagon.proxy.ProxyInfo; import org.apache.maven.wagon.repository.Repository; -import org.apache.maven.wagon.repository.RepositoryPermissions; -import org.codehaus.plexus.PlexusContainer; -import org.codehaus.plexus.util.xml.Xpp3Dom; import java.io.File; -import java.util.Collection; import java.util.List; -import java.util.Map; -import java.util.Set; /** * Manages Wagon related operations in Maven. @@ -114,4 +106,8 @@ public interface WagonManager // All the tests fail that are specifically look for the contents of the listener fail without this. void setDownloadMonitor( TransferListener listener ); + + void addAuthenticationInfo( String repositoryId, String username, String password, String privateKey, + String passphrase ); + } diff --git a/maven-repository/src/main/java/org/apache/maven/repository/LegacyMavenRepositorySystem.java b/maven-repository/src/main/java/org/apache/maven/repository/LegacyMavenRepositorySystem.java index 9000ebf0ba..66a03ebdad 100644 --- a/maven-repository/src/main/java/org/apache/maven/repository/LegacyMavenRepositorySystem.java +++ b/maven-repository/src/main/java/org/apache/maven/repository/LegacyMavenRepositorySystem.java @@ -29,6 +29,7 @@ import org.apache.maven.artifact.Artifact; import org.apache.maven.artifact.ArtifactUtils; import org.apache.maven.artifact.InvalidRepositoryException; import org.apache.maven.artifact.factory.ArtifactFactory; +import org.apache.maven.artifact.manager.WagonManager; import org.apache.maven.artifact.metadata.ArtifactMetadataRetrievalException; import org.apache.maven.artifact.metadata.ArtifactMetadataSource; import org.apache.maven.artifact.metadata.ResolutionGroup; @@ -68,6 +69,10 @@ import org.codehaus.plexus.util.StringUtils; public class LegacyMavenRepositorySystem implements MavenRepositorySystem { + + @Requirement + private WagonManager wagonManager; + @Requirement private ArtifactFactory artifactFactory; @@ -573,7 +578,8 @@ public class LegacyMavenRepositorySystem proxies.put( protocol, proxyInfo ); } - public void addAuthenticationInfo( String repositoryId, String username, String password, String privateKey, String passphrase ) + public void addAuthenticationInfo( String repositoryId, String username, String password, String privateKey, + String passphrase ) { AuthenticationInfo authInfo = new AuthenticationInfo(); authInfo.setUserName( username ); @@ -582,6 +588,8 @@ public class LegacyMavenRepositorySystem authInfo.setPassphrase( passphrase ); authenticationInfoMap.put( repositoryId, authInfo ); + + wagonManager.addAuthenticationInfo( repositoryId, username, password, privateKey, passphrase ); } public void addPermissionInfo( String repositoryId, String filePermissions, String directoryPermissions )