2
votes

I am trying to pull down a maven project that uses AWS. I have an aws IAM user with a key and password. I ran aws configure and configured the ~/.aws/credentials file in the default account. However, when I run maven clean install, I get the following error:

Failed to execute goal on project project-name: 
Could not resolve dependencies for project com.project:project-name:war:1.0: 
Failed to collect dependencies at com.project:commons-java:jar:1.0.0: 
Failed to read artifact descriptor for com.project:commons-java:jar:1.0.0: 
Could not transfer artifact com.project:commons-java:pom:1.0.0 
from/to project-maven-repo-releases (s3://project-maven-repo/releases): 
Unable to load AWS credentials from any provider in the chain

Clearly, maven cannot load the dependancies from s3. I have confirmed that my IAM user has s3 permissions. And, even though s3 is "regionless", I have supplied the correct region to the IAM account. I also have tried exporting the AWS variables to no avail. Any idea what could be the problem?

Thanks!

1
I have the same problem, have you found any solution in the end?user3738870

1 Answers

1
votes

I was struggling with what appears to be the same issue for a while. After checking my permissions in AWS and going through a variety of other troubleshooting steps, I think my issue was resolved through changing the directory permissions for a number of different files in the build path and repo that I was trying to build. I had inadvertently cloned them and copied them over as "root", such that, even with sudo permissions, maven was failing to read my Amazon credentials.

Another step you can take to narrow down the issue is to determine where the fault lies. I accomplished this by downloading the AWS python sample, which will attempt to create and add to a bucket in your s3. If this works, that means that the problem is with maven, and your credentials can be accessed by other applications just fine, and that you have the correct permissions as far as s3 is concerned. If the python sample also doesn't work, it is easier to get into and debug where exactly the issue is (in my opinion).