What are best practices for organizing repositories and package types?

We suggest you create local and remote repositories that have logical groupings according to teams, projects or resources. Here are a few rules of thumb:

  • For a given package-type that you are using, you should have the following:
    1. A Local-repository (or two if you want both snapshot and release repositories) 
    2. A Remote-repository for each pertinent remote repository location.
    3. A Virtual-repository that contains the local and remote repositories that you created in steps 1 and 2.
    • A given Virtual-repository should only point to repositories of a single package type;  do not mix package types in a virtual repository!
  • Virtual repositories resolve in the following order: 
    1. Local repositories in order
    2. Remote repositories’s local cache in order
    3. Remote repositories in order
    • Be mindful of this. Additionally, to optimize performance, avoid overloading your virtual repositories with things that a particular group or project type will not need to resolve.
  • Always resolve from JCenter before Maven repo.
  • Teams may want to have their own local repositories to control permissions; you can combine all of them into a virtual repository for resolution of those artifacts.