From 03d54fa1d0bbdf623ce51274ca0ddc2319b61457 Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Thu, 15 Oct 2015 16:15:23 -0700 Subject: [PATCH] Polish --- .../boot/maven/AbstractRunMojo.java | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/AbstractRunMojo.java b/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/AbstractRunMojo.java index 860f559083..87db9f90a5 100644 --- a/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/AbstractRunMojo.java +++ b/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/AbstractRunMojo.java @@ -53,8 +53,6 @@ public abstract class AbstractRunMojo extends AbstractDependencyFilterMojo { private static final String SPRING_LOADED_AGENT_CLASSNAME = "org.springsource.loaded.agent.SpringLoadedAgent"; - private static final String ACTIVE_PROFILES_PROPERTY = "spring.profiles.active"; - /** * The Maven project. * @since 1.0 @@ -104,8 +102,8 @@ public abstract class AbstractRunMojo extends AbstractDependencyFilterMojo { /** * The spring profiles to activate. Convenience shortcut of specifying the - * 'spring.profiles.active' argument. On command line use commas to separate - * multiple profiles. + * 'spring.profiles.active' argument. On command line use commas to separate multiple + * profiles. * @since 1.3 */ @Parameter(property = "run.profiles") @@ -289,15 +287,14 @@ public abstract class AbstractRunMojo extends AbstractDependencyFilterMojo { private void addActiveProfileArgument(RunArguments arguments) { if (this.profiles.length > 0) { - StringBuilder sb = new StringBuilder("--") - .append(ACTIVE_PROFILES_PROPERTY).append("="); + StringBuilder arg = new StringBuilder("--spring.profiles.active="); for (int i = 0; i < this.profiles.length; i++) { - sb.append(this.profiles[i]); + arg.append(this.profiles[i]); if (i < this.profiles.length - 1) { - sb.append(","); + arg.append(","); } } - arguments.getArgs().addFirst(sb.toString()); + arguments.getArgs().addFirst(arg.toString()); logArguments("Active profile(s): ", this.profiles); } }