You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Ondrej Zizka (JIRA)" <ji...@codehaus.org> on 2010/12/19 01:20:57 UTC
[jira] Created: (MNG-4946) Let the order of profiles in `mvn -P...`
determine their order in effective POM
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
[jira] Commented: (MNG-4946) Let the order of profiles in `mvn
-P...` determine their order in effective POM
Posted by "Ondrej Zizka (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-4946?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=249217#action_249217 ]
Ondrej Zizka commented on MNG-4946:
-----------------------------------
The use case is any case when you want to have the profiles precedence under control.
Since Maven builds customization is based on merging one POM into other, the user should be able to specify the order in which this operation happens for the same-level "entities", e.g. two profiles in settings.xml.
Do you really think that CLI param is something unstable? Usually the builds are run from some CI tool or at least script, anyway.
Plus, this would apply only when the profiles actually overlap. In that case, it's most probably intentional, and it's their author's responsibility to document the proper order in which they are to be applied.
> 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
[jira] Commented: (MNG-4946) Let the order of profiles in `mvn
-P...` determine their order in effective POM
Posted by "Ondrej Zizka (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-4946?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=249202#action_249202 ]
Ondrej Zizka commented on MNG-4946:
-----------------------------------
Currently, the resulting order is:
1. settings.xml - Auto-activated profiles (<activation/>), reverse definition order
2. settings.xml - CLI activated profiles, reverse definition order
3. pom.xml repos
4. parent pom repos
And adding auto-activated profile to -P does not change the result.
> 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
[jira] Issue Comment Edited: (MNG-4946) Let the order of profiles
in `mvn -P...` determine their order in effective POM
Posted by "Ondrej Zizka (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-4946?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=249217#action_249217 ]
Ondrej Zizka edited comment on MNG-4946 at 12/20/10 7:51 PM:
-------------------------------------------------------------
Hi Benjamin,
The use case is any case when the user needs to have the profiles precedence under control.
Since Maven builds customization is based on merging one POM into other, the user should be able to specify the order in which this operation happens for the same-level "entities", e.g. two profiles in settings.xml.
Do you really think that CLI param order is something unstable? Usually the builds are run from some CI tool or at least a script, anyway.
Plus, this would apply only when the profiles actually overlap. In that case, it's most probably intentional, and it's their author's responsibility to document the proper order in which they are to be applied.
was (Author: pekarna):
Hi Benjamin,
The use case is any case when the user needs to have the profiles precedence under control.
Since Maven builds customization is based on merging one POM into other, the user should be able to specify the order in which this operation happens for the same-level "entities", e.g. two profiles in settings.xml.
Do you really think that CLI param order is something unstable? Usually the builds are run from some CI tool or at least script, anyway.
Plus, this would apply only when the profiles actually overlap. In that case, it's most probably intentional, and it's their author's responsibility to document the proper order in which they are to be applied.
> 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
[jira] Issue Comment Edited: (MNG-4946) Let the order of profiles
in `mvn -P...` determine their order in effective POM
Posted by "Ondrej Zizka (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-4946?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=249217#action_249217 ]
Ondrej Zizka edited comment on MNG-4946 at 12/20/10 7:33 PM:
-------------------------------------------------------------
Hi Benjamin,
The use case is any case when the user needs to have the profiles precedence under control.
Since Maven builds customization is based on merging one POM into other, the user should be able to specify the order in which this operation happens for the same-level "entities", e.g. two profiles in settings.xml.
Do you really think that CLI param order is something unstable? Usually the builds are run from some CI tool or at least script, anyway.
Plus, this would apply only when the profiles actually overlap. In that case, it's most probably intentional, and it's their author's responsibility to document the proper order in which they are to be applied.
was (Author: pekarna):
Hi Benjamin,
The use case is any case when the user needs to have the profiles precedence under control.
Since Maven builds customization is based on merging one POM into other, the user should be able to specify the order in which this operation happens for the same-level "entities", e.g. two profiles in settings.xml.
Do you really think that CLI param is something unstable? Usually the builds are run from some CI tool or at least script, anyway.
Plus, this would apply only when the profiles actually overlap. In that case, it's most probably intentional, and it's their author's responsibility to document the proper order in which they are to be applied.
> 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
[jira] Commented: (MNG-4946) Let the order of profiles in `mvn
-P...` determine their order in effective POM
Posted by "Benjamin Bentmann (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-4946?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=249250#action_249250 ]
Benjamin Bentmann commented on MNG-4946:
----------------------------------------
bq. The use case is any case when the user needs to have the profiles precedence under control.
I fail to see how this answers my question for a practical usage scenario that would require this.
bq. [..] the user should be able to specify the order in which this operation happens for the same-level "entities", e.g. two profiles in settings.xml.
Which he can be adjusting their declaration order in the settings or POM.
bq. Do you really think that CLI param order is something unstable?
Whether documented or not, it's defacto behavior that "-Pfoo,bar" and "-Pbar,foo" yield the same effective POM. So users are not used to pay attention to the profile order on the CLI.
bq. Plus, this would apply only when the profiles actually overlap.
What are overlapping profiles? For instance, two profiles could configure two different plugins (no overlap), bound to the same phase. What you suggest would effect the order of plugin executions, likely breaking builds.
> 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
[jira] Commented: (MNG-4946) Let the order of profiles in `mvn
-P...` determine their order in effective POM
Posted by "Ondrej Zizka (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-4946?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=249257#action_249257 ]
Ondrej Zizka commented on MNG-4946:
-----------------------------------
> Which he can be adjusting their declaration order in the settings or POM.
It can not if some of them are auto-activated. Those go first, no matter what.
One real use case:
settings.xml with two profiles, 1) profA, auto-activated, 2) profB, activated by -P profB.
They contain different repository definition.
I need Maven to query profB's repository first, but there's no way because Maven ignores the order of -P.
If this improvement was implemented, I could do "mvn install -PprofB,profA", and voi-la - Maven would do what I need.
> 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
[jira] Commented: (MNG-4946) Let the order of profiles in `mvn
-P...` determine their order in effective POM
Posted by "Bob Fields (JIRA)" <ji...@codehaus.org>.
[ 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
[jira] Commented: (MNG-4946) Let the order of profiles in `mvn
-P...` determine their order in effective POM
Posted by "Benjamin Bentmann (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-4946?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=249204#action_249204 ]
Benjamin Bentmann commented on MNG-4946:
----------------------------------------
What is the actual use case or motivation for this request? It seems rather dangerous to make builds dependent on something like the CLI param order as this adds further variation between developers and threatens the idea of reproducible builds more.
> 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
[jira] Issue Comment Edited: (MNG-4946) Let the order of profiles
in `mvn -P...` determine their order in effective POM
Posted by "Ondrej Zizka (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-4946?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=249217#action_249217 ]
Ondrej Zizka edited comment on MNG-4946 at 12/20/10 7:31 PM:
-------------------------------------------------------------
Hi Benjamin,
The use case is any case when the user needs to have the profiles precedence under control.
Since Maven builds customization is based on merging one POM into other, the user should be able to specify the order in which this operation happens for the same-level "entities", e.g. two profiles in settings.xml.
Do you really think that CLI param is something unstable? Usually the builds are run from some CI tool or at least script, anyway.
Plus, this would apply only when the profiles actually overlap. In that case, it's most probably intentional, and it's their author's responsibility to document the proper order in which they are to be applied.
was (Author: pekarna):
Hi Benjamin,
The use case is any case when you want to have the profiles precedence under control.
Since Maven builds customization is based on merging one POM into other, the user should be able to specify the order in which this operation happens for the same-level "entities", e.g. two profiles in settings.xml.
Do you really think that CLI param is something unstable? Usually the builds are run from some CI tool or at least script, anyway.
Plus, this would apply only when the profiles actually overlap. In that case, it's most probably intentional, and it's their author's responsibility to document the proper order in which they are to be applied.
> 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
[jira] Issue Comment Edited: (MNG-4946) Let the order of profiles
in `mvn -P...` determine their order in effective POM
Posted by "Ondrej Zizka (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-4946?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=249217#action_249217 ]
Ondrej Zizka edited comment on MNG-4946 at 12/20/10 7:30 PM:
-------------------------------------------------------------
Hi Benjamin,
The use case is any case when you want to have the profiles precedence under control.
Since Maven builds customization is based on merging one POM into other, the user should be able to specify the order in which this operation happens for the same-level "entities", e.g. two profiles in settings.xml.
Do you really think that CLI param is something unstable? Usually the builds are run from some CI tool or at least script, anyway.
Plus, this would apply only when the profiles actually overlap. In that case, it's most probably intentional, and it's their author's responsibility to document the proper order in which they are to be applied.
was (Author: pekarna):
The use case is any case when you want to have the profiles precedence under control.
Since Maven builds customization is based on merging one POM into other, the user should be able to specify the order in which this operation happens for the same-level "entities", e.g. two profiles in settings.xml.
Do you really think that CLI param is something unstable? Usually the builds are run from some CI tool or at least script, anyway.
Plus, this would apply only when the profiles actually overlap. In that case, it's most probably intentional, and it's their author's responsibility to document the proper order in which they are to be applied.
> 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
[jira] Issue Comment Edited: (MNG-4946) Let the order of profiles
in `mvn -P...` determine their order in effective POM
Posted by "Ondrej Zizka (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-4946?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=249257#action_249257 ]
Ondrej Zizka edited comment on MNG-4946 at 12/21/10 6:33 AM:
-------------------------------------------------------------
> Which he can be adjusting their declaration order in the settings or POM.
That's my point - changing settings.xml everytime you need to change your build is not much user-friendly,
and when you need to do int programatically, it's kind of annoying.
And even when defining in XML, you can *not* set the order in all cases:
if some of the profiles are auto-activated. Those go first, no matter what.
One real use case:
settings.xml with two profiles, 1) profA, auto-activated, 2) profB, activated by -P profB.
They contain different repository definition.
I need Maven to query profB's repository first, but there's no way because Maven ignores the order of -P.
If this improvement was implemented, I could do "mvn install -PprofB,profA", and voi-la - Maven would do what I need.
was (Author: pekarna):
> Which he can be adjusting their declaration order in the settings or POM.
It can not if some of them are auto-activated. Those go first, no matter what.
One real use case:
settings.xml with two profiles, 1) profA, auto-activated, 2) profB, activated by -P profB.
They contain different repository definition.
I need Maven to query profB's repository first, but there's no way because Maven ignores the order of -P.
If this improvement was implemented, I could do "mvn install -PprofB,profA", and voi-la - Maven would do what I need.
> 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
[jira] Commented: (MNG-4946) Let the order of profiles in `mvn
-P...` determine their order in effective POM
Posted by "Ondrej Zizka (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-4946?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=249259#action_249259 ]
Ondrej Zizka commented on MNG-4946:
-----------------------------------
Ok how about limiting this effect only to the repositories?
> 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