[ 
http://jira.codehaus.org/browse/MNG-3614?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=143332#action_143332
 ] 

Aaron Digulla commented on MNG-3614:
------------------------------------

I have a similar issue: I have defined a property in the settings.xml with the 
version of the parent POM. Unfortunately, maven tries to validate the POM 
before loading the settings, so this doesn't work.

I would also expect that maven reads the settings file first, activate all 
profiles in there which should be active and then check again if the POM of the 
project defines more properties which influence the active profiles.

> 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
>            Priority: Minor
>             Fix For: 2.0.x
>
>
> 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.

-- 
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

        

Reply via email to