17

How to deploy with wagon s3 provider?

I've found several plugins, most of them are incomplete, some of them are not maintaned. There is also a sandbox plugin from official maven SVN repository but I'm figuring how to use it.

Any hint?

dfa
  • 114,442
  • 31
  • 189
  • 228
  • There is also some information about S3 wagon providers [on this question](https://stackoverflow.com/questions/49737238/mvn-deploy-not-loading-the-s3-credentials/) – James Render May 10 '19 at 10:38

4 Answers4

13

There is a newer s3 provider by spring which works:

<build>
    <extensions>
        <extension>
            <groupId>org.springframework.build.aws</groupId>
            <artifactId>org.springframework.build.aws.maven</artifactId>
            <version>3.0.0.RELEASE</version>
        </extension>
    </extensions>
</build>

If you would like to use it with maven 3, you need encrypt you passphrase in your settings.xml.

Step-by-step instructions are here.

rmuller
  • 12,062
  • 4
  • 64
  • 92
elek
  • 4,556
  • 1
  • 16
  • 6
  • This extension is now very old and doesn't seem to work any more with the current AWS: https://stackoverflow.com/questions/49737238/mvn-deploy-not-loading-the-s3-credentials – Pablo Fernandez Apr 10 '18 at 11:37
12

This wagon is what we are using to deploy to S3. It's similar to Spring's, but has multi-threaded upload support.

This lets the CI server push a lot of Maven content out to S3 very quickly. (22k files and 400mb's of content in ~50 seconds)

https://github.com/jcaddel/maven-s3-wagon

<build>
 <extensions>
   <extension>
    <groupId>org.kuali.maven.wagons</groupId>
    <artifactId>maven-s3-wagon</artifactId>
    <version>1.2.1</version>
   </extension>
 </extensions>
</build>
Jeff Caddel
  • 334
  • 3
  • 5
  • 1
    Hi @Jeff Caddel - What if I wanted to pull/download already uploaded jar in my current project from s3 repository? – prayagupa Oct 23 '14 at 11:40
  • This extension is now very old and doesn't seem to work any more with the current AWS: https://stackoverflow.com/questions/49737238/mvn-deploy-not-loading-the-s3-credentials – Pablo Fernandez Apr 10 '18 at 11:37
  • It doesn't seem to work with existing buckets of other regions. I've tried with other region like "ap-southeast-3" and got "IllegalLocationConstraintException, AWS Error Message: The ap-southeast-3 location constraint is incompatible for the region specific endpoint this request was sent to". – emeraldhieu Aug 05 '22 at 08:09
2

Another alternative:

<build>
  <extensions>
    <extension>
      <groupId>org.cyclopsgroup</groupId>
      <artifactId>awss3-maven-wagon</artifactId>
      <version>0.1</version>
    </extension>
  </extensions>
  [...]
</build>

Then in settings.xml:

<servers>
  <server>
    <id>foo.s3</id>
    <username>AKIAJ.......OLVBA</username>
    <password>PsndORui..............KGZtDpeIYjsA/</password>
  </server>
</servers>

And then in your pom.xml:

<distributionManagement>
  <repository>
    <id>foo</id>
    <url>s3://foo.s3/</url>
  </repository>
</distributionManagement>

Should work.

yegor256
  • 102,010
  • 123
  • 446
  • 597
  • I tried this one but it doesn't seem to set the files to public view like the kuali one does. I had to go into s3 after the upload to set them manually. – ksclarke Mar 12 '15 at 14:20
0

Another option, which is a fork of the jcaddel plugin, was last updated March 2016 but works for me:

<extension>
    <groupId>co.axiomzen.maven.wagons</groupId>
    <artifactId>maven-s3-wagon</artifactId>
    <version>1.2.6</version>
</extension>

Looks like the main weaknesses are: old AWS SDK version, doesn't use the Default AWS Credentials Chain, so lacks support for things like credentials from ECS. Also, characters like "@" and ":" in the URL don't get encoded properly, though I'm not sure if that's a problem with the wagon or with Maven.

Shannon
  • 1,073
  • 9
  • 22