diff options
author | Olivier Lamy <olamy@apache.org> | 2012-02-04 22:08:28 +0000 |
---|---|---|
committer | Olivier Lamy <olamy@apache.org> | 2012-02-04 22:08:28 +0000 |
commit | 5d6774f5f2560c02911c6e9846eccd08a12b86a8 (patch) | |
tree | 37f8fddca14439a8eba47861d6d5b65e32779ff6 /archiva-modules/archiva-base/archiva-proxy-common | |
parent | e258bfb349b02210a7de84821c798fa1fb75c5d8 (diff) | |
download | archiva-5d6774f5f2560c02911c6e9846eccd08a12b86a8.tar.gz archiva-5d6774f5f2560c02911c6e9846eccd08a12b86a8.zip |
[MRM-1599] NTLM proxy no longer works
use a new wagon with spring bean http-ntlm if proxy use ntlm
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1240623 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules/archiva-base/archiva-proxy-common')
4 files changed, 11 insertions, 11 deletions
diff --git a/archiva-modules/archiva-base/archiva-proxy-common/pom.xml b/archiva-modules/archiva-base/archiva-proxy-common/pom.xml index c8f296f4e..454b3be1c 100644 --- a/archiva-modules/archiva-base/archiva-proxy-common/pom.xml +++ b/archiva-modules/archiva-base/archiva-proxy-common/pom.xml @@ -43,6 +43,11 @@ </dependency> <dependency> <groupId>org.apache.maven.wagon</groupId> + <artifactId>wagon-http-lightweight</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.apache.maven.wagon</groupId> <artifactId>wagon-http</artifactId> <scope>test</scope> <exclusions> diff --git a/archiva-modules/archiva-base/archiva-proxy-common/src/main/java/org/apache/archiva/proxy/common/DefaultWagonFactory.java b/archiva-modules/archiva-base/archiva-proxy-common/src/main/java/org/apache/archiva/proxy/common/DefaultWagonFactory.java index bf9d7e9c2..8bf469a7a 100755 --- a/archiva-modules/archiva-base/archiva-proxy-common/src/main/java/org/apache/archiva/proxy/common/DefaultWagonFactory.java +++ b/archiva-modules/archiva-base/archiva-proxy-common/src/main/java/org/apache/archiva/proxy/common/DefaultWagonFactory.java @@ -37,16 +37,13 @@ public class DefaultWagonFactory implements WagonFactory { - private PlexusSisuBridge plexusSisuBridge; - private ApplicationContext applicationContext; private DebugTransferListener debugTransferListener = new DebugTransferListener(); @Inject - public DefaultWagonFactory( PlexusSisuBridge plexusSisuBridge, ApplicationContext applicationContext ) + public DefaultWagonFactory( ApplicationContext applicationContext ) { - this.plexusSisuBridge = plexusSisuBridge; this.applicationContext = applicationContext; } @@ -55,18 +52,12 @@ public class DefaultWagonFactory { try { - // with sisu inject bridge hint is file or http - // so remove wagon# - //protocol = StringUtils.remove( protocol, "wagon#" ); - // spring beans will be named wagon#protocol (http, https, file ) protocol = StringUtils.startsWith( protocol, "wagon#" ) ? protocol : "wagon#" + protocol; - //Wagon wagon = plexusSisuBridge.lookup( Wagon.class, protocol ); Wagon wagon = applicationContext.getBean( protocol, Wagon.class ); wagon.addTransferListener( debugTransferListener ); return wagon; } - //catch ( PlexusSisuBridgeException e ) catch ( BeansException e ) { throw new WagonFactoryException( e.getMessage(), e ); diff --git a/archiva-modules/archiva-base/archiva-proxy-common/src/main/java/org/apache/archiva/proxy/common/WagonFactory.java b/archiva-modules/archiva-base/archiva-proxy-common/src/main/java/org/apache/archiva/proxy/common/WagonFactory.java index 3768f8e3b..98eb427c2 100644 --- a/archiva-modules/archiva-base/archiva-proxy-common/src/main/java/org/apache/archiva/proxy/common/WagonFactory.java +++ b/archiva-modules/archiva-base/archiva-proxy-common/src/main/java/org/apache/archiva/proxy/common/WagonFactory.java @@ -30,7 +30,7 @@ public interface WagonFactory * Create a new Wagon instance for the given protocol. * * @param protocol the protocol to find the Wagon for, which must be prefixed with <code>wagon#</code>, for example - * <code>wagon#http</code>. + * <code>wagon#http</code>. <b>to have a wagon supporting ntlm add -ntlm</b> * @return the Wagon instance */ Wagon getWagon( String protocol ) diff --git a/archiva-modules/archiva-base/archiva-proxy-common/src/main/resources/META-INF/spring-context.xml b/archiva-modules/archiva-base/archiva-proxy-common/src/main/resources/META-INF/spring-context.xml index ef68e5561..217a33d3b 100644 --- a/archiva-modules/archiva-base/archiva-proxy-common/src/main/resources/META-INF/spring-context.xml +++ b/archiva-modules/archiva-base/archiva-proxy-common/src/main/resources/META-INF/spring-context.xml @@ -34,4 +34,8 @@ <bean name="wagon#https" scope="prototype" class="org.apache.maven.wagon.providers.http.HttpWagon"/> + <bean name="wagon#http-ntlm" scope="prototype" class="org.apache.maven.wagon.providers.http.LightweightHttpWagon"/> + + <bean name="wagon#https-ntlm" scope="prototype" class="org.apache.maven.wagon.providers.http.LightweightHttpsWagon"/> + </beans>
\ No newline at end of file |