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

左心房为你撑大大i 提交于 2020-01-02 06:01:27

问题


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


回答1:


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




回答2:


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/



来源:https://stackoverflow.com/questions/25224864/can-maven-ref-a-parent-pom-from-a-private-s3-bucket

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!