maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bentm...@apache.org
Subject svn commit: r929483 - /maven/maven-3/trunk/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java
Date Wed, 31 Mar 2010 11:38:44 GMT
Author: bentmann
Date: Wed Mar 31 11:38:44 2010
New Revision: 929483

URL: http://svn.apache.org/viewvc?rev=929483&view=rev
Log:
[MNG-2276] profile activation by property doesn't work with properties defined in settings

Modified:
    maven/maven-3/trunk/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java

Modified: maven/maven-3/trunk/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java
URL: http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java?rev=929483&r1=929482&r2=929483&view=diff
==============================================================================
--- maven/maven-3/trunk/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java
(original)
+++ maven/maven-3/trunk/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java
Wed Mar 31 11:38:44 2010
@@ -28,6 +28,7 @@ import java.util.LinkedHashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.HashMap;
+import java.util.Properties;
 
 import org.apache.maven.model.Dependency;
 import org.apache.maven.model.DependencyManagement;
@@ -134,6 +135,17 @@ public class DefaultModelBuilder
         List<Profile> activeExternalProfiles =
             profileSelector.getActiveProfiles( request.getProfiles(), profileActivationContext,
problems );
 
+        if ( !activeExternalProfiles.isEmpty() )
+        {
+            Properties profileProps = new Properties();
+            for ( Profile profile : activeExternalProfiles )
+            {
+                profileProps.putAll( profile.getProperties() );
+            }
+            profileProps.putAll( profileActivationContext.getUserProperties() );
+            profileActivationContext.setUserProperties( profileProps );
+        }
+
         Model inputModel = readModel( request.getModelSource(), request.getPomFile(), request,
problems );
 
         problems.setRootModel( inputModel );



Mime
View raw message