Giter VIP home page Giter VIP logo

awss3-maven-wagon's Introduction

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.

awss3-maven-wagon's People

Contributors

dependabot[bot] avatar jiaqi avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.