Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I assign a maven dependency to a specific repo?

So I have several large projects that use up to 8 different external repos, all specified in settings.xml rather than in poms. A lot of our internal dependencies are snapshots, so this obviously causes a lot of checking for updates across several external repos, when they are all in our internal repo.

So my question is, is there a way to setup a profile/filter or anything similar where I can ensure that an update will only be checked for in a specific repo(s)?

This is all in the spirit of better/quicker builds.

like image 963
markdsievers Avatar asked Oct 14 '22 04:10

markdsievers


1 Answers

There is no such feature in Maven proper, though you can achieve the same by installing repository manager and replacing all references in your settings.xml with a single reference to the repo manager. This also simplifies and centralizes the configuration for the whole team and gives you more control over what you use.

Both Sonatype Nexus and JFrog Artifactory support "artifact routing" using wildcards or regexes. If it's too difficult to propose something like this in your organization, you can install the repo manager on your desktop - usually they do not take too much resources.

like image 87
ddimitrov Avatar answered Oct 19 '22 10:10

ddimitrov