S3 Maven Wagon

Maven Wagon to support S3 repository

License

License

Categories

Categories

AWS Container PaaS Providers Maven Build Tools Cyclops General Purpose Libraries Functional Programming
GroupId

GroupId

org.cyclopsgroup
ArtifactId

ArtifactId

awss3-maven-wagon
Last Version

Last Version

1.5.0
Release Date

Release Date

Type

Type

jar
Description

Description

S3 Maven Wagon
Maven Wagon to support S3 repository
Project URL

Project URL

https://github.com/jiaqi/awss3-maven-wagon
Source Code Management

Source Code Management

https://github.com/jiaqi/awss3-maven-wagon

Download awss3-maven-wagon

How to add to project

<!-- https://jarcasting.com/artifacts/org.cyclopsgroup/awss3-maven-wagon/ -->
<dependency>
    <groupId>org.cyclopsgroup</groupId>
    <artifactId>awss3-maven-wagon</artifactId>
    <version>1.5.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.cyclopsgroup/awss3-maven-wagon/
implementation 'org.cyclopsgroup:awss3-maven-wagon:1.5.0'
// https://jarcasting.com/artifacts/org.cyclopsgroup/awss3-maven-wagon/
implementation ("org.cyclopsgroup:awss3-maven-wagon:1.5.0")
'org.cyclopsgroup:awss3-maven-wagon:jar:1.5.0'
<dependency org="org.cyclopsgroup" name="awss3-maven-wagon" rev="1.5.0">
  <artifact name="awss3-maven-wagon" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.cyclopsgroup', module='awss3-maven-wagon', version='1.5.0')
)
libraryDependencies += "org.cyclopsgroup" % "awss3-maven-wagon" % "1.5.0"
[org.cyclopsgroup/awss3-maven-wagon "1.5.0"]

Dependencies

compile (7)

Group / Artifact Type Version
javax.activation : activation jar 1.1.1
com.amazonaws : aws-java-sdk-core jar 1.11.651
com.amazonaws : aws-java-sdk-s3 jar 1.11.651
commons-lang : commons-lang jar 2.6
com.google.code.findbugs : jsr305 jar 3.0.2
commons-io : commons-io jar 2.6
org.apache.maven.wagon : wagon-provider-api jar 3.3.3

test (2)

Group / Artifact Type Version
org.junit.jupiter : junit-jupiter jar 5.5.2
org.apache.maven.wagon : wagon-provider-test jar 3.3.3

Project Modules

There are no modules declared in this project.

S3 Maven Wagon

An extension of Maven that read and write dependencies, artifacts and Maven site files in AWS S3.

To get started, first define the extension in the POM file.

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

With the extension defined, the protocol s3:// becomes available for url of repositories. Now we can define the repository for dependencies with it. This following definition declares a snapshot repository.

<repositories>
  <repository>
    <id>my-server</id>
    <name>My snapshot repository</name>
    <releases>
      <enabled>false</enabled>
    </releases>
    <snapshots>
      <enabled>true</enabled>
      <updatePolicy>always</updatePolicy>
      <checksumPolicy>warn</checksumPolicy>
    </snapshots>
    <url>s3://mybucket/maven/snapshot-repository</url>
  </repository>
</repositories>

And following definition makes sure artifacts are uploaded to the same s3 repository.

<distributionManagement>
  <snapshotRepository>
    <id>my-server</id>
    <name>My snapshot server</name>
    <url>s3://mybucket/maven/snapshot-repository</url>
  </snapshotRepository>
</distributionManagement>

Unless your s3 bucket is open to public, the credentials need to be added to $HOME/.m2/settings.xml.

<servers>
  <server>
    <id>my-server</id>
    <username>AWS Key ID</username>
    <password>AWS Secret Key</password>
  </server>

With settings above, mvn deploy uploads artifacts to the S3 bucket. The same setup works for site distribution as well.

<distributionManagement>
  <site>
    <id>my-server</id>
    <url>s3://mybucket/projects/jmxterm</url>
  </site>
</distributionManagement>

Now maven site:deploy uploads genrated maven site to the s3 bucket.

By defining the extension creatively at the top of the POM structure, people can create an organization with private maven repository protected by AWS IAM.

Versions

Version
1.5.0
1.4.2
1.4.1
1.4.0
0.1