You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Dan Allen (JIRA)" <ji...@codehaus.org> on 2010/06/16 07:17:12 UTC

[jira] Commented: (MNG-4709) Separate local repository for each remote repository

    [ http://jira.codehaus.org/browse/MNG-4709?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=225409#action_225409 ] 

Dan Allen commented on MNG-4709:
--------------------------------

It's more than just good. It's essential.

Currently, there is one local repository, but let's refer to it a cache. If I build project 1, which depends on repository A and repository B, my cache will be populated with the required dependencies fetch from either of those two repositories. If I then build project 2, which depends on repository C, it will consult my local cache for artifacts and may find artifacts that were pulled from repository A or B, even if they are not in repository C. What we have is an inconsistent truth. There is no way that project 2 should ever see the artifacts from A and B. Absolutely not.

In fact, this whole concept of "nuking your local repository" should have been a huge red flag that something is seriously wrong. A cache should never be a superset of what it is caching. Yet, that's what is happening. In fact, Maven is creating a local repository that is completely unique from any other repository in the world (and not just a subset of a known repository).

If it's true that repository artifacts are never removed remotely (which is a fairly reliable truth), you should definitely never have to nuke your local repository.

What needs to happen is that there needs to be a local repository for each remote repository.

~/.m2/repository/A
~/.m2/repository/B
~/.m2/repository/C

Only if I add repository B to project 2 should it find artifacts that where fetched by building project 1...and then only those from repository B, not A.

To cite a precedence, this is how apt and yum work.

> Separate local repository for each remote repository
> ----------------------------------------------------
>
>                 Key: MNG-4709
>                 URL: http://jira.codehaus.org/browse/MNG-4709
>             Project: Maven 2 & 3
>          Issue Type: New Feature
>          Components: Artifacts and Repositories
>            Reporter: Paul Gier
>            Assignee: Brett Porter
>
> It would be good if Maven used a separate local repository directory for each remote repository that was used.  This would avoid the problem of two repositories using the same GAV for a different artifact.  This would also allow the user to easily see where an artifact in the local repository was downloaded from.
> In addition the local repository used for "mvn install" could also be separated, so that it would not conflict with artifacts downloaded from remote repositories.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira