Download parent pom from remote repository

2019-07-05 10:48发布

问题:

Is it possible (and how) to download the parent pom from a remote repository?

Why? I have a project setup with many modules. The parent pom specifies dependencies to third-party jars. If one of the modules needs a new feature in a later version of one of the jars, I'd like to:

  • update the parent pom with reference to the new jar
  • update the single module pom referring to the new parent pom.

However, this breaks the build for all other modules depending on the older parent pom. I get the error message

Non-resolvable parent POM: Could not find artifact company:modbase:pom:2.0.6 
in mirrored.repo.com (http:((mirrored.repos.com/pub/java/maven2) and 
'parent.relativePath' points at wrong local POM ...

The desired older parent pom is deployed at a remote maven repository specified in the pom file, however, maven tries to search in a repo specified as mirror in settings.xml.

回答1:

Just make a separate maven module out of the parent pom and after changing it make a new release which results in a new version which can be used as parent in other modules.



标签: maven-3