Can't override central repository in settings.xml since 2.1.1 release
---------------------------------------------------------------------

                 Key: MANTTASKS-198
                 URL: http://jira.codehaus.org/browse/MANTTASKS-198
             Project: Maven 2.x Ant Tasks
          Issue Type: Bug
    Affects Versions: 2.1.1
            Reporter: Peter Phillips
         Attachments: AbstractArtifactWithRepositoryTaskTest.java

Since MANTTASKS-195 it is no longer possible to override the central repository 
(http://repo1.maven.org/maven2).

The AbstractArtifactWithRepositoryTask#createRemoteArtifactRepositories method 
now checks to see if a repository with the same id has already been added and 
therefore doesn't override it.

The problem with that is if remote repositories is not defined then the first 
item in the list contains the default remote repository.  The code then loops 
over the pom repositories (in my case coming from ~/.m2/settings.xml), finds a 
duplicate 'central' and ignores it.

One fix would be to move the addition of the default remote repository below 
the loop over the pom repositories so that the code prefers the locally defined 
central instead.

Attached is a test case exposing the defect.

-- 
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

        

Reply via email to