mirror of https://github.com/apache/maven.git
[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
This commit is contained in:
parent
e45fa790c7
commit
8daea5f1a7
|
@ -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 );
|
||||
|
|
Loading…
Reference in New Issue