简体   繁体   中英

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM