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

Bob Fields commented on MNG-4946:
---------------------------------

What could the possible motivation be for putting the repositories in REVERSE 
order of precedence, and putting the parent and global settings ahead of the 
local project settings? That is so counter-intuitive, one of the reasons why 
people complain about maven so much. I've spent many hours wondering what whim 
causes it to overwrite newer snapshot artifacts with older versions. In my case 
I have a staging repository activated by profile, with newer versions of the 
snapshot artifacts already in our public repository, but the local maven user 
gets the public snapshots even when the staging profile is activated. An 
intuitive ordering of the repositories search order for updates would be (from 
most local to least local, and overriding to manual to automatic profile 
activation):
1. Command line repository activation order (manually activated profiles 
overriding configured values)
2. Manually activated profiles
3. Automatically activated profiles
4. Local project profile(s) - manually activated 
5. Local project defaults
6. Parent project profile(s)- manually activated
7. Parent project default
8. Global settings.xml profile(s) - manually activated
9. Global settings.xml defaults

> Let the order of profiles in `mvn -P...` determine their order in effective 
> POM
> -------------------------------------------------------------------------------
>
>                 Key: MNG-4946
>                 URL: http://jira.codehaus.org/browse/MNG-4946
>             Project: Maven 2 & 3
>          Issue Type: Improvement
>          Components: Artifacts and Repositories
>    Affects Versions: 2.2.1
>            Reporter: Ondrej Zizka
>
> Currently, the order of profile references on the command line does not 
> affect the order in which they are merged to the effective POM.
> Easy test:
>   1) Create two profiles in settings-test.xml, say profA and profB
>   2) add a repository to each, say repoA, repoB
>   3) run `mvn -s settings-test.xml -PprofA,profB help:effective-pom`
>   4) run `mvn -s settings-test.xml -PprofB,profA help:effective-pom`
> You will see that the order of repositories is not affected by the order of 
> profiles after -P.
> This behavior is not documented, AFAICT, so changing it shouldn't be 
> considered as breaking backward compatibility.
> A possibility to determine the order in which profiles are applied would be a 
> great improvement since it would allow changing the build dramatically just 
> by slightly changing the command.

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