...
To solve this problem, Maven should use a separate local repository for each remote repository. Each local repository would function as a cache for the associated remote repository. The name of each local repository cache follows the format <repositoryId>-<url-hash>. In the event that the same repository ID is used to represent two different remote URLs, two separate repository caches would be created. If two repository IDs point to the same URL, the hash value can be used to identify that they are the same, and possibly store metadata that allows Maven to recognize the two as being the same.
No Format |
---|
.m2 |
...
+- repositories | +- central-<hash> |
...
| +- repoA-<hash> |
...
| \- repoB-<hash> |
The order in which Maven checks these local reopsitories is dependent on the build configuration. In the example above, the first build would use repo A to download org:myproj:1.0, and then second build would have repoB configured and use repoB to download and locally store the required org:myproj:1.0.
In addition, a separate repository should be used for installs/uploads to avoid conflicts with remote repositories.
No Format |
---|
.m2
+- repositories
| +- central-<hash>
| +- repoA-<hash>
| \- repoB-<hash>
\- workspace
|
Related Jira issues http://jira.codehaus.org/browse/MNG-3655
Repositories vs. Plugin Repositories
This proposal is also related to separation of repositories for project dependencies is the use of plugin repositories as discussed in 4302http://jira.codehaus.org/browse/MNG-47094302