jcaddel / maven-s3-wagon

Multi-threaded wagon to connect Maven with Amazon S3
123 stars 50 forks source link

Use newer AWS SDK that correctly handles buckets in different regions #8

Closed marshallpierce closed 11 years ago

marshallpierce commented 11 years ago

Right now, the plugin dies horribly if your bucket is in an unexpected region.

This is what's happening (via curl):

> GET /BUCKET-NAME HTTP/1.1
> User-Agent: curl/7.24.0 (x86_64-apple-darwin12.0) libcurl/7.24.0 OpenSSL/0.9.8r zlib/1.2.5
> Host: s3.amazonaws.com
> Accept: */*
>
< HTTP/1.1 301 Moved Permanently
< x-amz-request-id: D75BAD9E2517644B
< x-amz-id-2: drlAYrg34WM1pgL2sRZE7VHLNqdXV7JUHx9QOD5BY+V2DRugkaJE4RBiOPGOHvHx
< Content-Type: application/xml
< Transfer-Encoding: chunked
< Date: Thu, 18 Apr 2013 20:15:24 GMT
< Server: AmazonS3
<
<?xml version="1.0" encoding="UTF-8"?>
* Connection #0 to host s3.amazonaws.com left intact
<Error><Code>PermanentRedirect</Code><Message>The bucket you are attempting to access must be addressed using the specified endpoint. Please send all future requests to this endpoint.</Message><RequestId>D75BAD9E2517644B</RequestId><Bucket>BUCKET-NAME</Bucket><HostId>drlAYrg34WM1pgL2sRZE7VHLNqdXV7JUHx9QOD5BY+V2DRugkaJE4RBiOPGOHvHx</HostId><Endpoint>BUCKET-NAME.s3.amazonaws.com</Endpoint></Error>

The older version of the AWS SDK does not correctly handle this response, so the upload fails with:

Could not connect to repository: Unable to execute HTTP request: null: ClientProtocolException: Received redirect response HTTP/1.1 301 Moved Permanently but no location header

Switching to use an up-to-date version of the SDK solves this.

marshallpierce commented 11 years ago

Any chance you can release this? Right now my clients have to install a snapshot by hand...

jcaddel commented 11 years ago

Thanks for the pull request. Just released version 1.1.20 which contains this update.

marshallpierce commented 11 years ago

Great, thanks!