You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Benjamin Bentmann <be...@udo.edu> on 2008/12/29 12:39:14 UTC

MNG-2605

Hi,

quick question about MNG-2605: Is the current behavior a feature or a bug?

The problematic code is in ProfilesConversionUtils.java

         if ( profileActivation != null )
         {
             [convert it]
         }
         else
         {
             profile.setActivation( new AlwaysOnActivation() );
         }

which dates back to r189510 [1]. FWIW, a distro with the last line 
commented still passes our ITs (which admittedly doesn't say too much).

This issue appears to be either a "Won't fix" or a simple one to fix, 
ready for 2.0.11 and 2.1.0-M2. The docs about profiles [2, 3, 4] I know 
of seem not to cover this detail so before I take actions, I appreciate 
comments on the intended behavior here.


Benjamin


This issue
[0] http://jira.codehaus.org/browse/MNG-2605
[1] 
http://svn.eu.apache.org/viewvc/maven/components/trunk/maven-core/src/main/java/org/apache/maven/model/ModelNormalizationUtils.java?r1=189510&r2=188792&pathrev=189510
[2] http://docs.codehaus.org/display/MAVEN/Build+Profiles
[3] 
http://maven.apache.org/guides/introduction/introduction-to-profiles.html
[4] http://docs.codehaus.org/display/MAVENUSER/Profiles

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: MNG-2605

Posted by John Casey <jd...@commonjava.org>.
> 
> If it's the consensus that profiles defined in profiles.xml should not 
> be activeByDefault, I'm happy to go for it.

+1

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: MNG-2605

Posted by Benjamin Bentmann <be...@udo.edu>.
John Casey wrote:

> Is it possible that the only profiles which are ever fed through this 
> code are those that have been selected as active in the settings?

No, it seems the code I mentioned is called by 
DefaultMavenProjectBuilder.loadProjectExternalProfiles() for every 
profile listed in the profiles.xml.

By now an IT is online showing that for a profiles.xml like

<profilesXml>
   <profiles>
     <profile>
       <!-- NOTE: This has no activation, not even activeByDefault -->
       <id>mng-2605-profiles</id>
       <properties>
         <profilesProperty>INJECTED</profilesProperty>
       </properties>
     </profile>
   </profiles>
</profilesXml>

the profile "mng-2605-profiles" gets activated upon mere invocation of 
"mvn validate", i.e. without "-Pmng-2605-profiles".

> I'd say this code is out of date, and needs revision.

If it's the consensus that profiles defined in profiles.xml should not 
be activeByDefault, I'm happy to go for it.


Benjamin

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: MNG-2605

Posted by John Casey <jd...@commonjava.org>.
Is it possible that the only profiles which are ever fed through this 
code are those that have been selected as active in the settings? If 
that's not the case, it's possible that this code originally expected 
those conditions, since originally the only profiles brought in from 
settings were those explicitly named in the activeProfiles section.

I'd say this code is out of date, and needs revision.

Benjamin Bentmann wrote:
> Hi,
> 
> quick question about MNG-2605: Is the current behavior a feature or a bug?
> 
> The problematic code is in ProfilesConversionUtils.java
> 
>         if ( profileActivation != null )
>         {
>             [convert it]
>         }
>         else
>         {
>             profile.setActivation( new AlwaysOnActivation() );
>         }
> 
> which dates back to r189510 [1]. FWIW, a distro with the last line 
> commented still passes our ITs (which admittedly doesn't say too much).
> 
> This issue appears to be either a "Won't fix" or a simple one to fix, 
> ready for 2.0.11 and 2.1.0-M2. The docs about profiles [2, 3, 4] I know 
> of seem not to cover this detail so before I take actions, I appreciate 
> comments on the intended behavior here.
> 
> 
> Benjamin
> 
> 
> This issue
> [0] http://jira.codehaus.org/browse/MNG-2605
> [1] 
> http://svn.eu.apache.org/viewvc/maven/components/trunk/maven-core/src/main/java/org/apache/maven/model/ModelNormalizationUtils.java?r1=189510&r2=188792&pathrev=189510 
> 
> [2] http://docs.codehaus.org/display/MAVEN/Build+Profiles
> [3] 
> http://maven.apache.org/guides/introduction/introduction-to-profiles.html
> [4] http://docs.codehaus.org/display/MAVENUSER/Profiles
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org