We recommend that you create your local and remote repositories around logical groupings of teams, projects, and resources. Here are some things about which you should be aware and/or should do:
-
Any given package type that you're using should have the following:
-
A local repository (or two, if you want both snapshot and release repositories).
-
A remote repository for each of your remote registry locations.
-
A virtual repository that contains the local and remote repositories that you created in the two bullet points above.
Note: A given virtual repository should only point to the repositories of a single package type. Do not mix package types in a virtual repository!
-
Bear in mind that virtual repositories resolve in the following order:
-
Local repositories, in order
-
The local cache of remote repositories, in order
-
Remote repositories, in order
Note: To optimize performance, avoid overloading your virtual repositories with things that a particular group or project type will not need to resolve.
-
Always resolve your artifacts from JCenter before the Maven Repository.
-
Teams may want to have their own local repositories to control permissions. You can combine them all into a virtual repository for the resolution of those artifacts.
Published: Oct. 6, 2016
Last updated: Jan. 24, 2021
Keywords: best practices, repository management, package types