5

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

Alex
  • 2,435
  • 17
  • 18

2 Answers2

10

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

GuyPaddock
  • 2,233
  • 2
  • 23
  • 27
0

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/

  • 1
    This is no longer correct -- there is a way! In [one of the comments on the post you linked to](http://www.sonatype.org/nexus/2015/03/03/why-s3-is-not-the-perfect-maven-repository/#comment-1866), it mentions that in Maven 3.3.1 you can create a ".mvn/extensions.xml" file to pre-load the S3 wagon. – GuyPaddock Jun 26 '17 at 20:59