I\'m trying to use Amazon S3 to host my Maven artifacts. I\'ve added the following to my pom.xml:
If like me you're getting this message due to using a remote parent POM and Maven trying to load it before adding extensions (and therefore not being able to read s3://), see https://github.com/spring-projects/aws-maven/issues/25#issuecomment-112031441.
Doing this fixes it for me and allows me to keep parent remote and have maven still resolve it via s3 url and IAM permissions.
I couldn't get rid of the exception No connector available to access repository maven.xxx.com-snapshot (s3://maven.xxx.com/snapshot) of type default using the available factories WagonRepositoryConnectorFactory. The reason is, that I'm using a remote / stand-alone <parent>
POM and Maven seems to try to load that first and only add extensions afterwards. That's why the error is happening.
So, I needed to fall back to HTTP(S). However, I don't want to make my artifacts public, which rules out S3's static website hosting. Instead I'm using http://www.s3auth.com, which provides HTTP basic auth and is working great.
The only thing to watch out for:
Unfortunately, it doesn't support HTTPS at the moment, which is a major drawback.
Since Maven 3.3.1 you can simply create a file named ${maven.projectBasedir}/.mvn/extensions.xml
. This will be loaded first and works like a charme.
See this answer or directly check the release notes for further details.
I have created a sample project of how to use S3 bucket as maven repository.
https://github.com/wbinglee/maven-s3-repo
From your configuration, I don't see obvious problem. You can compare your project configuration with above sample project. If you cannot find the problem, you may need to share your full pom.xml.
Other option of using S3 as maven repository is directly using http
schema and configure S3 bucket as static web hosting. It's also included in above sample project with required configuration in README.
Then you can configure your maven repository configuration like below:
<repositories>
<repository>
<id>maven.xxx.com-release</id>
<name>AWS S3 Release Repository</name>
<url>http://maven.xxx.com.s3-website-ap-southeast-2.amazonaws.com/release</url>
</repository>
<repository>
<id>maven.xxx.com-snapshot</id>
<name>AWS S3 Snapshot Repository</name>
<url>http://maven.xxx.com.s3-website-ap-southeast-2.amazonaws.com/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
Hope that helps.