Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 382
Alex Avatar asked Aug 10 '14 02:08

Alex


People also ask

Where does Maven look for parent pom?

By default, Maven looks for the parent POM first at project's root, then the local repository, and lastly in the remote repository. If parent POM file is not located in any other place, then you can use code tag. This relative path shall be relative to project root.

Can S3 buckets be private?

By default, all S3 buckets are private and can be accessed only by users who are explicitly granted access. Restrict access to your S3 buckets or objects by doing the following: Writing IAM user policies that specify the users that can access specific buckets and objects.

What is Maven S3 wagon?

This project is an implementation of a multi-threaded Wagon provider for accessing Amazon's Simple Storage Service (S3). It enables Maven to download files from and deploy files to S3. It draws heavily from code developed by Jeff Caddel at Kuali and Ben Hale at SpringSource.


1 Answers

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

like image 79
GuyPaddock Avatar answered Sep 27 '22 00:09

GuyPaddock