You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Benjamin Bentmann (JIRA)" <ji...@codehaus.org> on 2009/03/24 15:51:13 UTC
[jira] Closed: (MNG-3614) settings.xml active profiles executed
AFTER project profiles have been loaded and activated/not activated
[ http://jira.codehaus.org/browse/MNG-3614?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Benjamin Bentmann closed MNG-3614.
----------------------------------
Assignee: Benjamin Bentmann
Resolution: Duplicate
Fix Version/s: (was: 2.1.x)
The problem is not the ordering per-se (one wants settings.xml profiles to be injected last into the POM to make sure user settings can override POM default properties, it's the extraction/aggregation of activation properties one would like to happen first).
The real issue is just that profile activation is currently limited to CLI properties (see MNG-2276).
> settings.xml active profiles executed AFTER project profiles have been loaded and activated/not activated
> ---------------------------------------------------------------------------------------------------------
>
> Key: MNG-3614
> URL: http://jira.codehaus.org/browse/MNG-3614
> Project: Maven 2
> Issue Type: Bug
> Components: Inheritance and Interpolation, Profiles, Settings
> Affects Versions: 2.0.9
> Environment: Solaris 5.10, ubuntu hardy x64
> Reporter: Donald Abrams
> Assignee: Benjamin Bentmann
> Priority: Minor
>
> If you have the following settings.xml in ~/.m2:
> {code:xml}
> <?xml version="1.0" encoding="UTF-8"?>
> <settings>
> <profiles>
> <profile>
> <id>userSettings</id>
> <activation>
> <activeByDefault/>
> </activation>
> <properties>
> <someproperty>true</someproperty>
> </properties>
> </profile>
> </profiles>
> <activeProfiles>
> <activeProfile>userSettings</activeProfile>
> </activeProfiles>
> </settings>
> {code}
> and another child pom.xml somewhere down the line has a profile with an activation like this:
> {code:xml}
> <project xmlns="http://maven.apache.org/POM/4.0.0">
> <modelVersion>4.0.0</modelVersion>
> <profiles>
> <profile>
> <id>with-something</id>
> <activation>
> <activeByDefault>false</activeByDefault>
> <property>
> <name>someproperty</name>
> <value>true</value>
> </property>
> </activation>
> </profile>
> </profiles>
> </project>
> {code}
> During run-time, the profile with-something will load before userSettings. This causes with-something to be incorrectly not activated (as the property someproperty does not exist). This can be seen with mvn help:active-profiles.
> I know why this is true, but it is non-intuitive and one would expect settings.xml profiles to be loaded before anything else.
--
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