A leiningen plugin for publishing to a private S3 maven repository.
Switch branches/tags
Clone or download
Latest commit 8c4e049 Oct 15, 2015
Type Name Latest commit message Commit time
Failed to load latest commit information.
resources/leiningen Initial commit. Mar 18, 2014
.gitignore Initial commit. Mar 18, 2014
LICENSE.txt Initial commit. Mar 18, 2014
README.org Fix version in README.org May 13, 2015
project.clj Version 0.2.6-SNAPSHOT Oct 15, 2015



What is this?

This is a leiningen plugin that wraps my fork of maven-s3-wagon.

What is an S3 wagon?

It is a maven plugin that allows you to publish and retrieve maven artifacts directly from S3.

Why did you fork maven-s3-wagon?

I forked it because I wanted an S3 wagon:

  1. That supports AWS multi-factor authentication (which maven-s3-wagon does), and
  2. That supports private S3 repos (which maven-s3-wagon does).

Sooo, why did you fork it again?

As far as I can tell, maven-s3-wagon doesn’t actually support using multi-factor authentication except if you’re running maven on an EC2 node. In addition to pulling in your access key and secret key from the environment, my fork also pulls in your session token from the environment.

Also, the way you publish to a private S3 repo with maven-s3-wagon is by configuring it to use a private ACL in your ~/.m2/settings.xml. As far as I can tell, there is no way to do this with leiningen (patches welcome!). My fork uses a private ACL as its default ACL.

OK, so how do I use it?

Add it to your project.clj as a plugin and define your repository:

(defproject my-project "0.1.0-SNAPSHOT"
  :deploy-repositories [["my-private-repo" {:url "s3://my-maven-repo/releases/"
                                            :username "AWS ACCESS KEY ID"
                                            :password "AWS SECRET ACCESS KEY"}]]
  :plugins [[lein-maven-s3-wagon "0.2.4"]]

Then you can publish your artifact to S3 using:

lein deploy my-private-repo

Do I have to have my AWS creds in the project.clj?

Absolutely not! Like any other repo, you can specify your credentials in your project.clj or specify them in ~/.lein/credentials.clj.gpg. You can also use keywords with the ‘env’ namespace (like :env/aws_access_key_id to have the credentials pulled from the environment).

Regardless of where the access key and secret key are pulled from, your session token for multi-factor authentication will always be pulled from the AWS_SECURITY_TOKEN environment variable. This environment variable name is compatible with the AWS command line interface (http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html)


Copyright © 2014 Paul Stadig. All rights reserved.

This Source Code Form is subject to the terms of the Mozilla Public License,
v. 2.0. If a copy of the MPL was not distributed with this file, You can
obtain one at http://mozilla.org/MPL/2.0/.

This Source Code Form is "Incompatible With Secondary Licenses", as defined
by the Mozilla Public License, v. 2.0.