Issue Details (XML | Word | Printable)

Key: MNG-2234
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Brett Porter
Reporter: Manfred Geiler
Votes: 7
Watchers: 7
Operations

If you were logged in you would be able to see more operations.
Maven 2 & 3

activeProfile in ~/.m2/settings.xml is ignored when profiles section is missing or empty

Created: 20/Apr/06 12:24 PM   Updated: 04/Mar/08 10:18 PM   Resolved: 04/Mar/08 10:18 PM
Return to search
Component/s: Profiles, Settings
Affects Version/s: 2.0.4
Fix Version/s: 2.0.9

Time Tracking:
Not Specified

Issue Links:
Duplicate
 

Complexity: Intermediate


 Description  « Hide

When i have this settings.xml file in my user home dir, the activeProfile setting is simply ignored by Maven:
<settings>
<activeProfiles>
<activeProfile>env-test</activeProfile>
</activeProfiles>
</settings>

Adding an empty profiles section does not help:
<settings>
<profiles>
</profiles>
<activeProfiles>
<activeProfile>env-test</activeProfile>
</activeProfiles>
</settings>

Well, adding a dummy profile makes it work:
<settings>
<profiles>
<profile>
<id>dummy</id>
</profile>
</profiles>
<activeProfiles>
<activeProfile>env-test</activeProfile>
</activeProfiles>
</settings>

Funny, isn't it?

Regards,
Manfred



John Casey added a comment - 20/Apr/06 05:19 PM

Assuming the activeProfiles section is only there to activate profiles that you've provided, how would you expect this to act?


Manfred Geiler added a comment - 20/Apr/06 05:30 PM

The actual profiles are defined in the pom.xml files (= best practice for environment settings - see http://maven.apache.org/guides/introduction/introduction-to-profiles.html).
To activate one of these profiles without always having to add a -P foobar option on the command line, it makes perfect sense to have this profile activation in the user's settings.xml.
And it really works. But only when there is a dummy profile in the settings.xml file.


Mathias Arens added a comment - 28/Aug/07 04:13 AM

I have the same problem with 2.0.7 and it would be great if this problem would be fixed in 2.0.8.


Jason van Zyl added a comment - 08/Sep/07 12:02 PM

After chatting with John, we can turn this on because a proposal is forth coming that will limit downstream profile activation to os, jdk, and activeByDefault. Everything else should be ignored. So we can let users turn on profiles in their settings but this begs the question, what is not being triggered by default in the project you're working on?


Krystian Nowak added a comment - 19/Sep/07 08:07 AM

It seems to be a duplicate of http://jira.codehaus.org/browse/MNG-3051