You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Abel MuiƱo <am...@gmail.com> on 2008/04/07 02:37:27 UTC

Possible bug activating external profiles?

External profiles defined with <activeByDefault>true</activeByDefault> are
always activated even when explicitly requested to by deactivated (by
including them in the MavenRequest.addInactiveProfiles().
I've seen this while embedding maven in Eclipse.

Looking at the code, it seems like that was not the intention (looks like an
unplanned side effect to me), but I'm running the question here before
creating a new ticket in JIRA.

The long description is...
 - DefaultMavenProjectBuilder requests the active external profiles in line
721 by calling DefaultProfileAdvisor.applyActivatedExternalProfiles().
 - applyActivatedExternalProfiles() delegates (line 99) into
applyActivatedProfiles()
 - applyActivatedProfiles() delegates in
DefaultProfileManager.getActiveProfiles()
 - getActiveProfiles() does it job and then, on line 240 checks if
activeFromPom() is empty.
   - it always is! (for this call) since we are not looking for profiles
defined in the pom
   - so all the profiles activeByDefault are added to the result, which
ignores any explicit Inactivation.

I think that an easy solution (if this is really a bug) would be to pass a
flag to know when the profiles are being queried from the pom and when from
external files.

Thanks for your responses!

-----
http://www.linkedin.com/in/amuino Abel Mui&ntilde;o Vizcaino  -  
http://ramblingabout.wordpress.com http://ramblingabout.wordpress.com 
-- 
View this message in context: http://www.nabble.com/Possible-bug-activating-external-profiles--tp16531761s177p16531761.html
Sent from the Maven Developers mailing list archive at Nabble.com.


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