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 11:43:13 UTC

[jira] Updated: (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 updated MNG-3614:
-----------------------------------

    Description: 
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.


  was:
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.



> 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.1.x
>
>
> 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