You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Oleksandr Maksymchuk (JIRA)" <ji...@codehaus.org> on 2007/10/04 07:13:08 UTC
[jira] Created: (MNG-3229) Active by default profile is ignored
when another is specified explicitly.
Active by default profile is ignored when another is specified explicitly.
---------------------------------------------------------------------------
Key: MNG-3229
URL: http://jira.codehaus.org/browse/MNG-3229
Project: Maven 2
Issue Type: Bug
Components: Profiles
Affects Versions: 2.0.7
Reporter: Oleksandr Maksymchuk
When default profile is added its used only when there is no another profile specified to be used on command line via -P option.
So in the pom containig:
<profile>
<id>default</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<profile>
<id>dev</id>
<!-- Not active, should be called explicitly. -->
default profile is used only when running command without -P dev
mvn
but not used when running:
mvn -P dev
Expected: should be used in both variants as per doc.
--
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-3229) Active by default profile is ignored
when another is specified explicitly.
Posted by "Oleksandr Maksymchuk (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-3229?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_111792 ]
Oleksandr Maksymchuk commented on MNG-3229:
-------------------------------------------
Sounds like this works as required. But documentation is not clear about when the active by default profile is activated, so please add the following to the doc:
Active by default profiles are activated when there is not other profiles specified.
What are usage scenarios of active by default profiles? Why would one need them?
> Active by default profile is ignored when another is specified explicitly.
> ---------------------------------------------------------------------------
>
> Key: MNG-3229
> URL: http://jira.codehaus.org/browse/MNG-3229
> Project: Maven 2
> Issue Type: Bug
> Components: Profiles
> Affects Versions: 2.0.7
> Reporter: Oleksandr Maksymchuk
>
> When default profile is added its used only when there is no another profile specified to be used on command line via -P option.
> So in the pom containig:
> <profile>
> <id>default</id>
> <activation>
> <activeByDefault>true</activeByDefault>
> </activation>
> <profile>
> <id>dev</id>
> <!-- Not active, should be called explicitly. -->
> default profile is used only when running command without -P dev
> mvn
> but not used when running:
> mvn -P dev
> Expected: should be used in both variants as per doc.
--
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-3229) Active by default profile is ignored
when another is specified explicitly.
Posted by "Abhishekh Padmanbhan (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-3229?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=208630#action_208630 ]
Abhishekh Padmanbhan commented on MNG-3229:
-------------------------------------------
I dont think setting a profile activeByDefault really does what it is suppoded to or at least not what the document says. Find below the link that has the description of the issue
http://markmail.org/message/5xfhhzrmkiakxvzr
The workaround that I am using currently is
<profiles>
<profile>
<id>dev</id>
<activation> <property> <name>env</name> <value>dev</value> </property> </activation>
<properties><blah>true</blah></properties>
</profile>
<profile>
<id>prod</id>
<activation> <property> <name>env</name> <value>prod</value> </property> </activation>
<properties><blah>false</blah></properties>
</profile>
<profile>
<id>qa</id>
<activation> <property> <name>env</name> <value>qa</value> </property> </activation>
<properties><blah>false</blah></properties>
</profile>
<activeProfiles>
<activeProfile>dev</activeProfile>
</activeProfiles>
</profiles>
So I have the default profile to be the the active profile and make sure the default profile description (here dev) is listed as the first profile in the settings.xml. So if i activated any other profile through its respective activation condition it would override the default profile. Although both profiles are really active it looks like the one that is defined the last in the settings.xml overrides the previous ones.
> Active by default profile is ignored when another is specified explicitly.
> ---------------------------------------------------------------------------
>
> Key: MNG-3229
> URL: http://jira.codehaus.org/browse/MNG-3229
> Project: Maven 2 & 3
> Issue Type: Bug
> Components: Profiles
> Affects Versions: 2.0.7
> Reporter: Oleksandr Maksymchuk
> Fix For: Documentation Deficit
>
>
> When default profile is added its used only when there is no another profile specified to be used on command line via -P option.
> So in the pom containig:
> <profile>
> <id>default</id>
> <activation>
> <activeByDefault>true</activeByDefault>
> </activation>
> <profile>
> <id>dev</id>
> <!-- Not active, should be called explicitly. -->
> default profile is used only when running command without -P dev
> mvn
> but not used when running:
> mvn -P dev
> Expected: should be used in both variants as per doc.
--
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] Updated: (MNG-3229) Active by default profile is ignored
when another is specified explicitly.
Posted by "Brett Porter (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-3229?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Brett Porter updated MNG-3229:
------------------------------
Fix Version/s: Documentation Deficit
> Active by default profile is ignored when another is specified explicitly.
> ---------------------------------------------------------------------------
>
> Key: MNG-3229
> URL: http://jira.codehaus.org/browse/MNG-3229
> Project: Maven 2
> Issue Type: Bug
> Components: Profiles
> Affects Versions: 2.0.7
> Reporter: Oleksandr Maksymchuk
> Fix For: Documentation Deficit
>
>
> When default profile is added its used only when there is no another profile specified to be used on command line via -P option.
> So in the pom containig:
> <profile>
> <id>default</id>
> <activation>
> <activeByDefault>true</activeByDefault>
> </activation>
> <profile>
> <id>dev</id>
> <!-- Not active, should be called explicitly. -->
> default profile is used only when running command without -P dev
> mvn
> but not used when running:
> mvn -P dev
> Expected: should be used in both variants as per doc.
--
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] (MNG-3229) Active by default profile is ignored when
another is specified explicitly.
Posted by "Ronald Chen (JIRA)" <ji...@codehaus.org>.
[ https://jira.codehaus.org/browse/MNG-3229?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=313033#comment-313033 ]
Ronald Chen commented on MNG-3229:
----------------------------------
Not a bug. As intended. activeByDefault is ONLY used when no -P are used
> Active by default profile is ignored when another is specified explicitly.
> ---------------------------------------------------------------------------
>
> Key: MNG-3229
> URL: https://jira.codehaus.org/browse/MNG-3229
> Project: Maven 2 & 3
> Issue Type: Bug
> Components: Profiles
> Affects Versions: 2.0.7
> Reporter: Oleksandr Maksymchuk
> Fix For: Documentation Deficit
>
>
> When default profile is added its used only when there is no another profile specified to be used on command line via -P option.
> So in the pom containig:
> <profile>
> <id>default</id>
> <activation>
> <activeByDefault>true</activeByDefault>
> </activation>
> <profile>
> <id>dev</id>
> <!-- Not active, should be called explicitly. -->
> default profile is used only when running command without -P dev
> mvn
> but not used when running:
> mvn -P dev
> Expected: should be used in both variants as per doc.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (MNG-3229) Active by default profile is ignored
when another is specified explicitly.
Posted by "Wendy Smoak (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-3229?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_122054 ]
Wendy Smoak commented on MNG-3229:
----------------------------------
I always understood activeByDefault to mean "active _unless_ another profile is explicitly specified".
Testing with 2.0.8, I'm seeing *both* profiles active, which is what you asked for, but *not* how it has ever worked in the past.
Can someone confirm?
> Active by default profile is ignored when another is specified explicitly.
> ---------------------------------------------------------------------------
>
> Key: MNG-3229
> URL: http://jira.codehaus.org/browse/MNG-3229
> Project: Maven 2
> Issue Type: Bug
> Components: Profiles
> Affects Versions: 2.0.7
> Reporter: Oleksandr Maksymchuk
> Fix For: Documentation Deficit
>
>
> When default profile is added its used only when there is no another profile specified to be used on command line via -P option.
> So in the pom containig:
> <profile>
> <id>default</id>
> <activation>
> <activeByDefault>true</activeByDefault>
> </activation>
> <profile>
> <id>dev</id>
> <!-- Not active, should be called explicitly. -->
> default profile is used only when running command without -P dev
> mvn
> but not used when running:
> mvn -P dev
> Expected: should be used in both variants as per doc.
--
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-3229) Active by default profile is ignored
when another is specified explicitly.
Posted by "Wendy Smoak (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-3229?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_122057 ]
Wendy Smoak commented on MNG-3229:
----------------------------------
Apparently there is some debate around this topic. :)
On irc, Brian mentioned that the activeByDefault behavior we are discussing only works in pom.xml. Then later,
jdcasey: wsmoak: activeByDefault should never work in settings or profiles.xml
jdcasey: you have to use activeProfiles
jdcasey: that's the way it was designed, it was just an oversight to put those fields in the model for profiles.xml and settings.xml
wsmoak: personally I always use activeProfiles. what I'm seeing is that activeByDefault *does* (sort of) work in settings.xml -- it activates the profile.
wsmoak: but you lose the 'deactivate when another profile is specified' behavior.
jdcasey: hmm
jdcasey: it shouldn't be active at all...that's a bug, at least in the current design. I know a lot of people disagree on how profiles should work when coming from external sources, though
With 2.0.8, I am able to activate a profile (permanently!) by using activeByDefault in settings.xml.
> Active by default profile is ignored when another is specified explicitly.
> ---------------------------------------------------------------------------
>
> Key: MNG-3229
> URL: http://jira.codehaus.org/browse/MNG-3229
> Project: Maven 2
> Issue Type: Bug
> Components: Profiles
> Affects Versions: 2.0.7
> Reporter: Oleksandr Maksymchuk
> Fix For: Documentation Deficit
>
>
> When default profile is added its used only when there is no another profile specified to be used on command line via -P option.
> So in the pom containig:
> <profile>
> <id>default</id>
> <activation>
> <activeByDefault>true</activeByDefault>
> </activation>
> <profile>
> <id>dev</id>
> <!-- Not active, should be called explicitly. -->
> default profile is used only when running command without -P dev
> mvn
> but not used when running:
> mvn -P dev
> Expected: should be used in both variants as per doc.
--
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-3229) Active by default profile
is ignored when another is specified explicitly.
Posted by "Abhishekh Padmanbhan (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-3229?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=208630#action_208630 ]
Abhishekh Padmanbhan edited comment on MNG-3229 at 2/17/10 9:30 AM:
--------------------------------------------------------------------
I dont think setting a profile activeByDefault really does what it is suppoded to or at least not what the document says. Find below the link that has the description of the issue
http://markmail.org/message/5xfhhzrmkiakxvzr
The workaround that I am using currently is
{code:xml}
<profiles>
<profile>
<id>dev</id>
<activation>
<property>
<name>env</name>
<value>dev</value>
</property>
</activation>
<properties>
<blah>true</blah>
</properties>
</profile>
<profile>
<id>prod</id>
<activation>
<property>
<name>env</name>
<value>prod</value>
</property>
</activation>
<properties>
<blah>false</blah>
</properties>
</profile>
<profile>
<id>qa</id>
<activation>
<property>
<name>env</name>
<value>qa</value>
</property>
</activation>
<properties>
<blah>false</blah>
</properties>
</profile>
<activeProfiles>
<activeProfile>dev</activeProfile>
</activeProfiles>
</profiles>
{code}
So I have the default profile to be the the active profile and make sure the default profile description (here dev) is listed as the first profile in the settings.xml. So if i activated any other profile through its respective activation condition it would override the default profile. Although both profiles are really active it looks like the one that is defined the last in the settings.xml overrides the previous ones.
was (Author: abhishekhp):
I dont think setting a profile activeByDefault really does what it is suppoded to or at least not what the document says. Find below the link that has the description of the issue
http://markmail.org/message/5xfhhzrmkiakxvzr
The workaround that I am using currently is
<profiles>
<profile>
<id>dev</id>
<activation> <property> <name>env</name> <value>dev</value> </property> </activation>
<properties><blah>true</blah></properties>
</profile>
<profile>
<id>prod</id>
<activation> <property> <name>env</name> <value>prod</value> </property> </activation>
<properties><blah>false</blah></properties>
</profile>
<profile>
<id>qa</id>
<activation> <property> <name>env</name> <value>qa</value> </property> </activation>
<properties><blah>false</blah></properties>
</profile>
<activeProfiles>
<activeProfile>dev</activeProfile>
</activeProfiles>
</profiles>
So I have the default profile to be the the active profile and make sure the default profile description (here dev) is listed as the first profile in the settings.xml. So if i activated any other profile through its respective activation condition it would override the default profile. Although both profiles are really active it looks like the one that is defined the last in the settings.xml overrides the previous ones.
> Active by default profile is ignored when another is specified explicitly.
> ---------------------------------------------------------------------------
>
> Key: MNG-3229
> URL: http://jira.codehaus.org/browse/MNG-3229
> Project: Maven 2 & 3
> Issue Type: Bug
> Components: Profiles
> Affects Versions: 2.0.7
> Reporter: Oleksandr Maksymchuk
> Fix For: Documentation Deficit
>
>
> When default profile is added its used only when there is no another profile specified to be used on command line via -P option.
> So in the pom containig:
> <profile>
> <id>default</id>
> <activation>
> <activeByDefault>true</activeByDefault>
> </activation>
> <profile>
> <id>dev</id>
> <!-- Not active, should be called explicitly. -->
> default profile is used only when running command without -P dev
> mvn
> but not used when running:
> mvn -P dev
> Expected: should be used in both variants as per doc.
--
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