Amazon Web Services S3 Maven Wagon Support

Standard Maven wagon support for s3:// urls

Лицензия

Лицензия

Категории

Категории

Сеть
Группа

Группа

net.rootware
Идентификатор

Идентификатор

s3wagon
Последняя версия

Последняя версия

7.1.0
Дата

Дата

Тип

Тип

jar
Описание

Описание

Amazon Web Services S3 Maven Wagon Support
Standard Maven wagon support for s3:// urls
Ссылка на сайт

Ссылка на сайт

https://github.com/platform-team/aws-maven
Организация-разработчик

Организация-разработчик

Platform Team
Система контроля версий

Система контроля версий

https://github.com/platform-team/aws-maven

Скачать s3wagon

Как подключить последнюю версию

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

Зависимости

compile (5)

Идентификатор библиотеки Тип Версия
ch.qos.logback : logback-classic jar 1.2.3
com.amazonaws : aws-java-sdk jar 1.11.276
org.slf4j : jcl-over-slf4j jar 1.7.25
org.slf4j : slf4j-api jar 1.7.25
org.apache.commons : commons-lang3 jar 3.7

provided (1)

Идентификатор библиотеки Тип Версия
org.apache.maven.wagon : wagon-provider-api jar 3.0.0

test (4)

Идентификатор библиотеки Тип Версия
junit : junit jar 4.12
pl.pragmatists : JUnitParams jar 1.1.1
org.mockito : mockito-core jar 2.15.0
org.hamcrest : hamcrest-all jar 1.3

Модули Проекта

Данный проект не имеет модулей.

AWS Maven Wagon

##NOTE: THIS PROJECT IS NOT SUPPORTED ANYMORE!!!

GitHub version License

Dependency Status Build Status Coverage Status

Description

This project is a fork of a Maven Wagon for Amazon S3. In order to to publish artifacts to an S3 bucket, the user (as identified by their access key) must be listed as an owner on the bucket.

Why this fork?

  • original repo not maintained for a long time but we updated fork to the latest libs.
  • we fixed some of issues that blocks others and us.
  • no support from maintainers of original repo.

Usage

To publish Maven artifacts to S3 a build extension must be defined in a project's pom.xml. The latest version of the wagon can be found on the aws-maven page in Maven Central.

<project>
  ...
  <build>
    ...
    <extensions>
      ...
      <extension>
        <groupId>com.github.platform-team</groupId>
        <artifactId>aws-maven</artifactId>
        <version>6.0.0</version>
      </extension>
      ...
    </extensions>
    ...
  </build>
  ...
</project>

Once the build extension is configured distribution management repositories can be defined in the pom.xml with an s3:// scheme.

<project>
  ...
  <distributionManagement>
    <repository>
      <id>aws-release</id>
      <name>AWS Release Repository</name>
      <url>s3://<BUCKET>/release</url>
    </repository>
    <snapshotRepository>
      <id>aws-snapshot</id>
      <name>AWS Snapshot Repository</name>
      <url>s3://<BUCKET>/snapshot</url>
    </snapshotRepository>
  </distributionManagement>
  ...
</project>

Finally the ~/.m2/settings.xml must be updated to include access and secret keys for the account. The access key should be used to populate the username element, and the secret access key should be used to populate the password element.

<settings>
  ...
  <servers>
    ...
    <server>
      <id>aws-release</id>
      <username>0123456789ABCDEFGHIJ</username>
      <password>0123456789abcdefghijklmnopqrstuvwxyzABCD</password>
      <configuration>
        <wagonProvider>s3</wagonProvider>
      </configuration>
    </server>
    <server>
      <id>aws-snapshot</id>
      <username>0123456789ABCDEFGHIJ</username>
      <password>0123456789abcdefghijklmnopqrstuvwxyzABCD</password>
      <configuration>
        <wagonProvider>s3</wagonProvider>
      </configuration>
    </server>
    ...
  </servers>
  ...
</settings>

Connecting through a Proxy

For being able to connect behind an HTTP proxy you need to add the following configuration to ~/.m2/settings.xml:

<settings>
  ...
  <proxies>
     ...
     <proxy>
         <active>true</active>
         <protocol>s3</protocol>
         <host>myproxy.host.com</host>
         <port>8080</port>
         <username>proxyuser</username>
         <password>somepassword</password>
         <nonProxyHosts>www.google.com|*.somewhere.com</nonProxyHosts>
     </proxy>
     ...
    </proxies>
  ...
</settings>

Alternatively, the access and secret keys for the account can be provided using (applied in order below)

Making Artifacts Public

This wagon doesn't set an explict ACL for each artifact that is uploaded. Instead you should create an AWS Bucket Policy to set permissions on objects. A bucket policy can be set in the AWS Console and can be generated using the AWS Policy Generator.

In order to make the contents of a bucket public you need to add statements with the following details to your policy:

Effect Principal Action Amazon Resource Name (ARN)
Allow * ListBucket arn:aws:s3:::<BUCKET>
Allow * GetObject arn:aws:s3:::<BUCKET>/*

If your policy is setup properly it should look something like:

{
  "Id": "Policy1397027253868",
  "Statement": [
    {
      "Sid": "Stmt1397027243665",
      "Action": [
        "s3:ListBucket"
      ],
      "Effect": "Allow",
      "Resource": "arn:aws:s3:::<BUCKET>",
      "Principal": {
        "AWS": [
          "*"
        ]
      }
    },
    {
      "Sid": "Stmt1397027177153",
      "Action": [
        "s3:GetObject"
      ],
      "Effect": "Allow",
      "Resource": "arn:aws:s3:::<BUCKET>/*",
      "Principal": {
        "AWS": [
          "*"
        ]
      }
    }
  ]
}

If you prefer to use the command line, you can use the following script to make the contents of a bucket public:

BUCKET=<BUCKET>
TIMESTAMP=$(date +%Y%m%d%H%M)
POLICY=$(cat<<EOF
{
  "Id": "public-read-policy-$TIMESTAMP",
  "Statement": [
    {
      "Sid": "list-bucket-$TIMESTAMP",
      "Action": [
        "s3:ListBucket"
      ],
      "Effect": "Allow",
      "Resource": "arn:aws:s3:::$BUCKET",
      "Principal": {
        "AWS": [
          "*"
        ]
      }
    },
    {
      "Sid": "get-object-$TIMESTAMP",
      "Action": [
        "s3:GetObject"
      ],
      "Effect": "Allow",
      "Resource": "arn:aws:s3:::$BUCKET/*",
      "Principal": {
        "AWS": [
          "*"
        ]
      }
    }
  ]
}
EOF
)

aws s3api put-bucket-policy --bucket $BUCKET --policy "$POLICY"

Release Notes

  • 6.0.0
    • Updated to the latest versions of aws-sdk and maven-wagon.
    • Changed order of aws credential resolution strategy.
    • Added support of all regions defined in aws-sdk.

License

Copyright 2018-Present Platform Team.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

net.rootware

Platform Team

Версии библиотеки

Версия
7.1.0
7.0.0