Upgraded wagon-apis dependency to version 1.0-beta-6 and made corresponding changes to the implementation of the Wagon which now requires additional connect() methods with different signatures.
diff --git a/org.springframework.build.aws.maven/.classpath b/org.springframework.build.aws.maven/.classpath
index 49140ee..3b30f1c 100644
--- a/org.springframework.build.aws.maven/.classpath
+++ b/org.springframework.build.aws.maven/.classpath
@@ -1,13 +1,12 @@
<classpath>
- <classpathentry kind="src" path="src/main/java"/>
+ <classpathentry kind="src" path="src/main/java" including="**/*.java"/>
<classpathentry kind="src" path="src/main/resources" excluding="**/*.java"/>
- <classpathentry kind="src" path="src/test/java" output="target/test-classes"/>
<classpathentry kind="output" path="target/classes"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="var" path="M2_REPO/commons-httpclient/commons-httpclient/3.1/commons-httpclient-3.1.jar"/>
- <classpathentry kind="var" path="M2_REPO/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.jar" sourcepath="M2_REPO/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/commons-codec/commons-codec/1.2/commons-codec-1.2.jar"/>
- <classpathentry kind="var" path="M2_REPO/net/java/dev/jets3t/jets3t/0.5.1-20080115/jets3t-0.6.0.jar" sourcepath="M2_REPO/net/java/dev/jets3t/jets3t/0.5.1-20080115/jets3t-0.6.0-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/apache/maven/wagon/wagon-provider-api/1.0-beta-2/wagon-provider-api-1.0-beta-2.jar" sourcepath="M2_REPO/org/apache/maven/wagon/wagon-provider-api/1.0-beta-2/wagon-provider-api-1.0-beta-2-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/codehaus/plexus/plexus-utils/1.0.4/plexus-utils-1.0.4.jar" sourcepath="M2_REPO/org/codehaus/plexus/plexus-utils/1.0.4/plexus-utils-1.0.4-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/commons-httpclient/commons-httpclient/3.1/commons-httpclient-3.1.jar"/>
+ <classpathentry kind="var" path="M2_REPO/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.jar"/>
+ <classpathentry kind="var" path="M2_REPO/net/java/dev/jets3t/jets3t/0.6.0/jets3t-0.6.0.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/codehaus/plexus/plexus-utils/1.4.2/plexus-utils-1.4.2.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/apache/maven/wagon/wagon-provider-api/1.0-beta-6/wagon-provider-api-1.0-beta-6.jar"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
</classpath>
\ No newline at end of file
diff --git a/org.springframework.build.aws.maven/pom.xml b/org.springframework.build.aws.maven/pom.xml
index 711e803..c5c7262 100644
--- a/org.springframework.build.aws.maven/pom.xml
+++ b/org.springframework.build.aws.maven/pom.xml
@@ -54,7 +54,7 @@
<dependency>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-provider-api</artifactId>
- <version>1.0-beta-2</version>
+ <version>1.0-beta-6</version>
<scope>provided</scope>
</dependency>
</dependencies>
diff --git a/org.springframework.build.aws.maven/src/main/java/org/springframework/aws/maven/AbstractWagon.java b/org.springframework.build.aws.maven/src/main/java/org/springframework/aws/maven/AbstractWagon.java
index 1e1c760..66f5245 100644
--- a/org.springframework.build.aws.maven/src/main/java/org/springframework/aws/maven/AbstractWagon.java
+++ b/org.springframework.build.aws.maven/src/main/java/org/springframework/aws/maven/AbstractWagon.java
@@ -26,6 +26,7 @@
import org.apache.maven.wagon.events.TransferEvent;
import org.apache.maven.wagon.events.TransferListener;
import org.apache.maven.wagon.proxy.ProxyInfo;
+import org.apache.maven.wagon.proxy.ProxyInfoProvider;
import org.apache.maven.wagon.repository.Repository;
import org.apache.maven.wagon.resource.Resource;
@@ -51,6 +52,8 @@
private TransferListenerSupport transferListeners = new TransferListenerSupport(this);
+ private int timeout;
+
protected AbstractWagon(boolean supportsDirectoryCopy) {
this.supportsDirectoryCopy = supportsDirectoryCopy;
}
@@ -100,7 +103,7 @@
}
public final void connect(Repository source) throws ConnectionException, AuthenticationException {
- connect(source, null, null);
+ connect(source, null, (ProxyInfoProvider)null);
}
public final void connect(Repository source, ProxyInfo proxyInfo) throws ConnectionException,
@@ -110,15 +113,33 @@
public final void connect(Repository source, AuthenticationInfo authenticationInfo) throws ConnectionException,
AuthenticationException {
- connect(source, authenticationInfo, null);
+ connect(source, authenticationInfo, (ProxyInfoProvider)null);
}
- public final void connect(Repository source, AuthenticationInfo authenticationInfo, ProxyInfo proxyInfo)
+ public void connect(Repository source, ProxyInfoProvider proxyInfoProvider) throws ConnectionException, AuthenticationException {
+ connect(source, null, proxyInfoProvider);
+ }
+
+ public void connect(Repository source, AuthenticationInfo authenticationInfo, ProxyInfo proxyInfo) throws ConnectionException, AuthenticationException {
+ final ProxyInfo proxy = proxyInfo;
+ connect(source, authenticationInfo, new ProxyInfoProvider() {
+ public ProxyInfo getProxyInfo(String protocol) {
+ if (protocol == null || proxy == null || protocol.equalsIgnoreCase(proxy.getType())) {
+ return proxy;
+ }
+ else {
+ return null;
+ }
+ }
+ } );
+ }
+
+ public final void connect(Repository source, AuthenticationInfo authenticationInfo, ProxyInfoProvider proxyInfoProvider)
throws ConnectionException, AuthenticationException {
repository = source;
sessionListeners.fireSessionOpening();
try {
- connectToRepository(source, authenticationInfo, proxyInfo);
+ connectToRepository(source, authenticationInfo, proxyInfoProvider);
}
catch (ConnectionException e) {
sessionListeners.fireSessionConnectionRefused();
@@ -284,9 +305,17 @@
return supportsDirectoryCopy;
}
+ public int getTimeout() {
+ return timeout;
+ }
+
+ public void setTimeout(int timeout) {
+ this.timeout = timeout;
+ }
+
/**
* Subclass must implement with specific connection behavior
- *
+ *
* @param source The repository connection information
* @param authenticationInfo Authentication information, if any
* @param proxyInfo Proxy information, if any
@@ -294,7 +323,7 @@
* handled by the base class
*/
protected abstract void connectToRepository(Repository source, AuthenticationInfo authenticationInfo,
- ProxyInfo proxyInfo) throws Exception;
+ ProxyInfoProvider proxyInfo) throws Exception;
/**
* Subclass must implement with specific detection behavior
diff --git a/org.springframework.build.aws.maven/src/main/java/org/springframework/aws/maven/SimpleStorageServiceWagon.java b/org.springframework.build.aws.maven/src/main/java/org/springframework/aws/maven/SimpleStorageServiceWagon.java
index 6fb37e0..f578732 100644
--- a/org.springframework.build.aws.maven/src/main/java/org/springframework/aws/maven/SimpleStorageServiceWagon.java
+++ b/org.springframework.build.aws.maven/src/main/java/org/springframework/aws/maven/SimpleStorageServiceWagon.java
@@ -18,7 +18,7 @@
import org.apache.maven.wagon.ResourceDoesNotExistException;
import org.apache.maven.wagon.authentication.AuthenticationException;
import org.apache.maven.wagon.authentication.AuthenticationInfo;
-import org.apache.maven.wagon.proxy.ProxyInfo;
+import org.apache.maven.wagon.proxy.ProxyInfoProvider;
import org.apache.maven.wagon.repository.Repository;
import org.jets3t.service.S3Service;
import org.jets3t.service.S3ServiceException;
@@ -60,7 +60,7 @@
super(false);
}
- protected void connectToRepository(Repository source, AuthenticationInfo authenticationInfo, ProxyInfo proxyInfo)
+ protected void connectToRepository(Repository source, AuthenticationInfo authenticationInfo, ProxyInfoProvider proxyInfoProvider)
throws AuthenticationException {
try {
service = new RestS3Service(getCredentials(authenticationInfo));