Can I assign a maven dependency to a specific repo?

So, I have several large projects that use up to 8 different external repositories, all of which are specified in settings.xml, and not in poms. Many of our internal dependencies are snapshots, so this obviously causes a lot of checking for updates in several external repositories when they are all in our internal repo.

So my question is: is there a way to set up a profile / filter or something similar, where can I make sure that the update will only be checked in certain repositories?

This is all in the spirit of the best / fast builds.

+5
source share
1 answer

There is no such function in Maven, although you can achieve the same by installing the repository manager and replacing all the links in your settings.xml with a single link to the repo manager. It also simplifies and centralizes the configuration for the entire team and gives you more control over what you use.

Both Sonatype Nexus and JFrog Artifactory support “artifact routing” using wildcards or regular expressions. If it’s too difficult to offer something like this in your organization, you can install the repo manager on your desktop - they usually do not take up too many resources.

+4
source

All Articles