Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Duplicate
-
2.0.9
-
None
-
None
-
Solaris 5.10, ubuntu hardy x64
Description
If you have the following settings.xml in ~/.m2:
<?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>
and another child pom.xml somewhere down the line has a profile with an activation like this:
<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>
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.