[ 
http://jira.codehaus.org/browse/MNG-4119?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Benjamin Bentmann closed MNG-4119.
----------------------------------

      Assignee: Benjamin Bentmann
    Resolution: Not A Bug

This behavior is by design, cf. [Introduction to build 
profiles|http://maven.apache.org/guides/introduction/introduction-to-profiles.html]:
bq. This profile will automatically be active for all builds unless another 
profile in the same pom is activated using one of the previously described 
methods. All profiles that are active by default are automatically deactivated 
when a profile in the pom is activated on the command line or through its 
activation config.

For your particular case, I think you could just get rid of using 
{{<activeByDefault>}}. Simply put default properties into the regular 
{{<properties>}} section of the POM. Other developers can still override these 
properties either from the CLI via {{-D}} or via some profile in their 
{{settings.xml}} just as you already proposed. 

> default profile is deactivated in pom
> -------------------------------------
>
>                 Key: MNG-4119
>                 URL: http://jira.codehaus.org/browse/MNG-4119
>             Project: Maven 2
>          Issue Type: Bug
>    Affects Versions: 2.0.10
>         Environment: linux, mvn 2.0.10
>            Reporter: Trenton
>            Assignee: Benjamin Bentmann
>
> In my pom, I have the following profiles...
>     <profile>
>       <id>nodebug</id>
>       <activation>
>         <activeByDefault>true</activeByDefault>
>       </activation>
>       <!--
>      Override this by creating a debug profile in settings.xml, and
>      doing mvn -Pdebug,profile1,profile2 install
>       -->
>       <properties>
>         <logger.level>INFO</logger.level>
>       </properties>
>     </profile>
>     <profile>
>       <id>skiptests</id>
>       <activation>
>         <activeByDefault>true</activeByDefault>
>       </activation>
>       <properties>
>         <maven.test.skip>true</maven.test.skip>
>       </properties>
>     </profile>
>     <profile>
>       <!-- activate this profile if you want to enable JUnit tests.  This
>            will override the same maven property in the skiptests -->
>       <id>test</id>
>       <properties>
>         <maven.test.skip>false</maven.test.skip>
>       </properties>
>     </profile>
> If I issue
> mvn -Plocal-aucm,inproc,local package
> everything works fine, and my log4j.properties loglevel is set to "INFO".
> If I issues...
> mvn -Ptest,local-aucm,inproc,local package
> My log4j.properties loglevel is set to "${logger.level}", without being 
> filtered properly.  So, it would seem that somehow my default active profile 
> "nodebug" is deactivated when passing in "test", and therefore the 
> "logger.level" property does not get set.
> If I move the "test" profile to my settings.xml, everything works fine.
> If I pass "nodebug" or "debug" into the -P, it is also fine.

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