From 9fade4977c9e5654c5c920f2d92fb6b5c531be5e Mon Sep 17 00:00:00 2001 From: Benoit Guerin Date: Tue, 11 Feb 2020 10:46:01 +0100 Subject: [PATCH] [MRELEASE-1038] releaseProfiles get overriden by exec.pomFileName --- .../maven/shared/release/config/ReleaseUtils.java | 2 +- .../shared/release/config/ReleaseUtilsTest.java | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/maven-release-manager/src/main/java/org/apache/maven/shared/release/config/ReleaseUtils.java b/maven-release-manager/src/main/java/org/apache/maven/shared/release/config/ReleaseUtils.java index 870f285f3..927278c34 100644 --- a/maven-release-manager/src/main/java/org/apache/maven/shared/release/config/ReleaseUtils.java +++ b/maven-release-manager/src/main/java/org/apache/maven/shared/release/config/ReleaseUtils.java @@ -129,7 +129,7 @@ public static void copyPropertiesToReleaseDescriptor( Properties properties, Rel } if ( properties.containsKey( "exec.activateProfiles" ) ) { - builder.setActivateProfiles( Arrays.asList( properties.getProperty( "exec.pomFileName" ).split( "," ) ) ); + builder.setActivateProfiles( Arrays.asList( properties.getProperty( "exec.activateProfiles" ).split( "," ) ) ); } if ( properties.containsKey( "preparationGoals" ) ) { diff --git a/maven-release-manager/src/test/java/org/apache/maven/shared/release/config/ReleaseUtilsTest.java b/maven-release-manager/src/test/java/org/apache/maven/shared/release/config/ReleaseUtilsTest.java index af3180d52..22faa9760 100644 --- a/maven-release-manager/src/test/java/org/apache/maven/shared/release/config/ReleaseUtilsTest.java +++ b/maven-release-manager/src/test/java/org/apache/maven/shared/release/config/ReleaseUtilsTest.java @@ -28,6 +28,7 @@ import java.io.File; import java.io.IOException; +import java.util.Arrays; import java.util.Properties; /** @@ -249,6 +250,17 @@ public void testSystemPropertyStartingWithDependency() properties.setProperty( "dependency.locations.enabled", "false" ); ReleaseUtils.copyPropertiesToReleaseDescriptor( properties, new ReleaseDescriptorBuilder() ); } + + // MRELEASE-1038 + public void testActiveProfilesProperty() + { + ReleaseDescriptorBuilder builder = new ReleaseDescriptorBuilder(); + Properties properties = new Properties(); + properties.setProperty( "exec.activateProfiles", "aProfile,anotherOne" ); + ReleaseUtils.copyPropertiesToReleaseDescriptor( properties, builder ); + + assertEquals( Arrays.asList("aProfile", "anotherOne"), builder.build().getActivateProfiles() ); + } private static ReleaseDescriptorBuilder copyReleaseDescriptor( ReleaseDescriptor originalReleaseDescriptor ) {