diff --git a/.gitignore b/.gitignore index b6f7c003..27c4191b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,12 @@ -.idea/libraries -.idea/tasks.xml -.idea/workspace.xml target +.settings +.springBeans +.classpath +.project +/.idea +/.gradle +/build +/*.iml +/*.ipr +/*.iws +bin/ diff --git a/README.md b/README.md index 5b274052..9c27e8fe 100644 --- a/README.md +++ b/README.md @@ -73,6 +73,8 @@ Alternatively, the access and secret keys for the account can be provided using * `AWS_ACCESS_KEY_ID` (or `AWS_ACCESS_KEY`) and `AWS_SECRET_KEY` (or `AWS_SECRET_ACCESS_KEY`) [environment variables][env-var] * `aws.accessKeyId` and `aws.secretKey` [system properties][sys-prop] * The Amazon EC2 [Instance Metadata Service][instance-metadata] +* Loads the AWS credential profiles file from the default location (`~/.aws/credentials`) or from an alternate location +if `AWS_CREDENTIAL_PROFILES_FILE` is set [AWS configuration profiles][profile-prop], [Config file details][profile-file-loc] ## Making Artifacts Public This wagon doesn't set an explict ACL for each artfact 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][console] and can be generated using the [AWS Policy Generator][policy-generator]. @@ -171,4 +173,6 @@ aws s3api put-bucket-policy --bucket $BUCKET --policy "$POLICY" [policy-generator]: http://awspolicygen.s3.amazonaws.com/policygen.html [s3]: http://aws.amazon.com/s3/ [sys-prop]: http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/auth/SystemPropertiesCredentialsProvider.html +[profile-prop]: http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/auth/profile/ProfileCredentialsProvider.html +[profile-file-loc]: http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/auth/profile/ProfilesConfigFile.html#ProfilesConfigFile-- [wagon]: http://maven.apache.org/wagon/ diff --git a/aws-maven.iml b/aws-maven.iml deleted file mode 100644 index 2e0133fc..00000000 --- a/aws-maven.iml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/pom.xml b/pom.xml index ce78b0f0..81b8f6c5 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ Standard Maven wagon support for s3:// urls - 1.7.1 + 1.11.118 4.11 1.1.1 1.9.5 diff --git a/src/main/java/org/springframework/build/aws/maven/AuthenticationInfoAWSCredentialsProviderChain.java b/src/main/java/org/springframework/build/aws/maven/AuthenticationInfoAWSCredentialsProviderChain.java index 86726039..87a1d214 100644 --- a/src/main/java/org/springframework/build/aws/maven/AuthenticationInfoAWSCredentialsProviderChain.java +++ b/src/main/java/org/springframework/build/aws/maven/AuthenticationInfoAWSCredentialsProviderChain.java @@ -20,6 +20,7 @@ import com.amazonaws.auth.EnvironmentVariableCredentialsProvider; import com.amazonaws.auth.InstanceProfileCredentialsProvider; import com.amazonaws.auth.SystemPropertiesCredentialsProvider; +import com.amazonaws.auth.profile.ProfileCredentialsProvider; import org.apache.maven.wagon.authentication.AuthenticationInfo; final class AuthenticationInfoAWSCredentialsProviderChain extends AWSCredentialsProviderChain { @@ -27,7 +28,8 @@ final class AuthenticationInfoAWSCredentialsProviderChain extends AWSCredentials AuthenticationInfoAWSCredentialsProviderChain(AuthenticationInfo authenticationInfo) { super(new EnvironmentVariableCredentialsProvider(), new SystemPropertiesCredentialsProvider(), - new InstanceProfileCredentialsProvider(), - new AuthenticationInfoAWSCredentialsProvider(authenticationInfo)); + InstanceProfileCredentialsProvider.getInstance(), + new AuthenticationInfoAWSCredentialsProvider(authenticationInfo), + new ProfileCredentialsProvider()); } }