This is not a duplicate of 2802. I don't need several local repositories to support concurrently running maven, I need it to create a hierarchy of repositories where artifacts are located.
Imagine a simple project, creating 2 jars named foo-bar-1.0.jar and foo-zoo-1.0.jar. zoo depends on bar.
I checkout the projects to a directory named named 'foo' (subdirectories 'bar' and 'zoo')
On Monday I come to work, and start developing a new feature. Happily coding and building. I need to install to local repository since 'zoo' depends on 'bar. All is well.
On Tuesday, my boss comes and tells me there's an urgent bug fix (be it in some client, or simply because QA wants to try out the current iteration of the projects but are blocked).
What do I do? I checkout the projects to a directory 'foo_bugfix' and start correcting the bug.
Now, If I build, the artifacts from 'foo_bugfix' will override those from 'foo'.
Maybe this doesn't sound like much of a problem for this toy example, when I return to work in 'foo', just do a complete build.
But, it becomes a headache for large projects with tens of modules. In such cases, a full rebuild may take a long time. Also, working with branches becomes an issue, since on every checkout from a branch, I need to change version numbers to avoid conflicts.
What I'm suggesting is to allow a user like me to define a local repository that is relative to the current build directory. All problems described above are gone. However, doing just that means that on every checkout I have to wait for all artifacts (plugins, 3rd party, nightly build) to be downloaded. So instead I want the best of both worlds: allow me to define a list of repositories that are examined for artifacts, in order. When installing an artifact, write it to the first repository on the list. Then, I can first setup a shared local repository and afterwards add a reference to a local repository with relative path where further downloaded/installed artifacts are put.
Another approach is to have two definitions: one for 'local repository' and the other for 'project repository'. All items downloaded go to 'local repository' and all installed items go to 'project repository', maybe with a way of configuring maven so that some downloaded items, from a nightly build, go to 'project repository'.
Btw, about nightly builds, it will be good if remote repositories could have a mechanism where if I checkout a branch, maven first tries to download from a repository specifically for that branch (maybe the repository url can have some configuration value, but as long as it's not something that I need to update on every checkout)