Skip to content

Commit

Permalink
[MRELEASE-1038] releaseProfiles get overriden by exec.pomFileName
Browse files Browse the repository at this point in the history
  • Loading branch information
Benoit Guerin committed Feb 11, 2020
1 parent 4494543 commit 9fade49
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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" ) )
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

import java.io.File;
import java.io.IOException;
import java.util.Arrays;
import java.util.Properties;

/**
Expand Down Expand Up @@ -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 )
{
Expand Down

0 comments on commit 9fade49

Please sign in to comment.