From 8daea5f1a79e0c91dfe15b51930fbdc34bc73d50 Mon Sep 17 00:00:00 2001 From: Benjamin Bentmann Date: Wed, 31 Mar 2010 11:38:44 +0000 Subject: [PATCH] [MNG-2276] profile activation by property doesn't work with properties defined in settings git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@929483 13f79535-47bb-0310-9956-ffa450edef68 --- .../maven/model/building/DefaultModelBuilder.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java b/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java index 17e335db58..b2b701adb6 100644 --- a/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java +++ b/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java @@ -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 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 );