Author: pgier
Date: Wed May 14 13:22:22 2008
New Revision: 656405
URL: http://svn.apache.org/viewvc?rev=656405&view=rev
Log:
Fix for profile deactivation.
Submitted By: David Bernhard
Issue id: MNG-3545
Modified:
maven/components/trunk/maven-project/src/main/java/org/apache/maven/profiles/DefaultProfileManager.java
Modified:
maven/components/trunk/maven-project/src/main/java/org/apache/maven/profiles/DefaultProfileManager.java
URL:
http://svn.apache.org/viewvc/maven/components/trunk/maven-project/src/main/java/org/apache/maven/profiles/DefaultProfileManager.java?rev=656405&r1=656404&r2=656405&view=diff
==============================================================================
---
maven/components/trunk/maven-project/src/main/java/org/apache/maven/profiles/DefaultProfileManager.java
(original)
+++
maven/components/trunk/maven-project/src/main/java/org/apache/maven/profiles/DefaultProfileManager.java
Wed May 14 13:22:22 2008
@@ -219,12 +219,12 @@
{
shouldAdd = true;
}
- else if ( !profileActivationContext.isExplicitlyInactive(
profileId ) && isActive( profile, profileActivationContext ) )
+ else if ( isActive( profile, profileActivationContext ) )
{
shouldAdd = true;
}
- if ( shouldAdd )
+ if ( !profileActivationContext.isExplicitlyInactive( profileId
) && shouldAdd )
{
if ( "pom".equals( profile.getSource() ) )
{
@@ -241,10 +241,18 @@
{
List defaultIds =
profileActivationContext.getActiveByDefaultProfileIds();
+ List deactivatedIds =
profileActivationContext.getExplicitlyInactiveProfileIds();
+
for ( Iterator it = defaultIds.iterator(); it.hasNext(); )
{
String profileId = (String) it.next();
-
+
+ // If this profile was excluded, don't
add it back in
+ // Fixes MNG-3545
+ if (deactivatedIds.contains(profileId))
+ {
+ continue;
+ }
Profile profile = (Profile) profilesById.get( profileId );
if ( profile != null )