Can Maven ref a parent POM from a private s3 bucket?

2.4k Views Asked by At

When using a private AWS S3 bucket as a Maven repo, there's plenty of working s3 wagon providers that work just fine for deploying and pulling dependencies using the s3://[bucket]/folder protocol.

However, when you try to do this with a parent POM reference, i.e.

  <parent>
    <groupId>com.my.company</groupId>
    <artifactId>my-parent-pom</artifactId>
    <version>1.0.0</version>
  </parent>

Which exists only in a private S3 Maven repo, it seems that Maven only checks the HTTP based defined repositories, and doesn't attempt to look in the S3 repo.

The S3 wagon in this project is defined as

<build>
<extensions>
  <extension>
    <groupId>org.springframework.build</groupId>
    <artifactId>aws-maven</artifactId>
    <version>5.0.0.RELEASE</version>
  </extension>
</extensions>
</build>

Which, again, works fine for normal dependencies, just not for a parent POM reference

Looking for some way to have a parent POM be properly resolved inside an S3 Maven repo

2

There are 2 best solutions below

0
On

Per my comment on the other post in this thread: If you're using Maven 3.2.5 or later, you can specify the plugin as a JAR on the command line.

If you're using Maven 3.3.1 or later, create a .mvn/extensions.xml file in your project that defines the S3 wagon so that it's pre-loaded by the time the parent POM is being resolved.

See Maven's 3.3.1 release notes for details: https://maven.apache.org/docs/3.3.1/release-notes.html

1
On

The answer is No.

The main issue with Maven and S3 repo is that Maven loads a parent POM before a S3 wagon.

Check here for details: http://www.sonatype.org/nexus/2015/03/03/why-s3-is-not-the-perfect-maven-repository/