diff --git a/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionRequest.java b/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionRequest.java index 7ba64ac74b..2180352580 100644 --- a/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionRequest.java +++ b/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionRequest.java @@ -715,6 +715,7 @@ public class DefaultMavenExecutionRequest projectBuildingConfiguration.setExecutionProperties( getProperties() ); projectBuildingConfiguration.setRemoteRepositories( getRemoteRepositories() ); projectBuildingConfiguration.setActiveProfileIds( getActiveProfiles() ); + projectBuildingConfiguration.setInactiveProfileIds( getInactiveProfiles() ); projectBuildingConfiguration.setProfiles( getProfiles() ); projectBuildingConfiguration.setProcessPlugins( true ); } diff --git a/maven-core/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java b/maven-core/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java index 070d39a091..544ec37b14 100644 --- a/maven-core/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java +++ b/maven-core/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java @@ -120,10 +120,8 @@ public class DefaultMavenProjectBuilder ProfileActivationContext profileActivationContext = new ProfileActivationContext( configuration.getExecutionProperties(), true ); profileActivationContext.setExplicitlyActiveProfileIds( configuration.getActiveProfileIds() ); - if (configuration.getExecutionProperties() != null ) - { - profileActivationContext.getExecutionProperties().putAll( configuration.getExecutionProperties() ); - } + profileActivationContext.setExplicitlyInactiveProfileIds( configuration.getInactiveProfileIds() ); + ProfileManager profileManager = new DefaultProfileManager( profileActivationContext ); try @@ -483,7 +481,7 @@ public class DefaultMavenProjectBuilder if ( validationResult.getMessageCount() > 0 ) { - for ( String s : (List) validationResult.getMessages() ) + for ( String s : validationResult.getMessages() ) { logger.error( s ); } diff --git a/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuilderConfiguration.java b/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuilderConfiguration.java index 201224d502..baa40433d2 100644 --- a/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuilderConfiguration.java +++ b/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuilderConfiguration.java @@ -44,6 +44,8 @@ public class DefaultProjectBuilderConfiguration private List activeProfileIds; + private List inactiveProfileIds; + private List profiles; public MavenProject getTopLevelProjectFromReactor() @@ -121,6 +123,16 @@ public class DefaultProjectBuilderConfiguration this.activeProfileIds = activeProfileIds; } + public List getInactiveProfileIds() + { + return inactiveProfileIds; + } + + public void setInactiveProfileIds( List inactiveProfileIds ) + { + this.inactiveProfileIds = inactiveProfileIds; + } + public void setProfiles( List profiles ) { this.profiles = profiles; diff --git a/maven-core/src/main/java/org/apache/maven/project/ProjectBuilderConfiguration.java b/maven-core/src/main/java/org/apache/maven/project/ProjectBuilderConfiguration.java index be8d3d1d5d..e00f2daaf8 100644 --- a/maven-core/src/main/java/org/apache/maven/project/ProjectBuilderConfiguration.java +++ b/maven-core/src/main/java/org/apache/maven/project/ProjectBuilderConfiguration.java @@ -37,6 +37,10 @@ public interface ProjectBuilderConfiguration void setActiveProfileIds( List activeProfileIds ); List getActiveProfileIds(); + + void setInactiveProfileIds( List inactiveProfileIds ); + + List getInactiveProfileIds(); /** * Add a {@link org.apache.maven.model.Profile} that has come from an external source. This may be from a custom configuration