Merge branch '2.2.x'

Closes gh-19463
This commit is contained in:
Stephane Nicoll
2019-12-26 11:18:55 +01:00
9 changed files with 162 additions and 5 deletions

View File

@@ -133,13 +133,21 @@ public abstract class AbstractRunMojo extends AbstractDependencyFilterMojo {
private Map<String, String> environmentVariables;
/**
* Arguments that should be passed to the application. On command line use commas to
* separate multiple arguments.
* Arguments that should be passed to the application.
* @since 1.0.0
*/
@Parameter(property = "spring-boot.run.arguments")
@Parameter
private String[] arguments;
/**
* Arguments from the command line that should be passed to the application. Use
* spaces to separate multiple arguments and make sure to wrap multiple values between
* quotes. When specified, takes precedence over {@link #arguments}.
* @since 2.2.3
*/
@Parameter(property = "spring-boot.run.arguments", readonly = true)
private String commandlineArguments;
/**
* The spring profiles to activate. Convenience shortcut of specifying the
* 'spring.profiles.active' argument. On command line use commas to separate multiple
@@ -311,7 +319,8 @@ public abstract class AbstractRunMojo extends AbstractDependencyFilterMojo {
* @return a {@link RunArguments} defining the application arguments
*/
protected RunArguments resolveApplicationArguments() {
RunArguments runArguments = new RunArguments(this.arguments);
RunArguments runArguments = (this.commandlineArguments != null) ? new RunArguments(this.commandlineArguments)
: new RunArguments(this.arguments);
addActiveProfileArgument(runArguments);
return runArguments;
}
@@ -327,7 +336,7 @@ public abstract class AbstractRunMojo extends AbstractDependencyFilterMojo {
private void addArgs(List<String> args) {
RunArguments applicationArguments = resolveApplicationArguments();
Collections.addAll(args, applicationArguments.asArray());
logArguments("Application argument(s): ", this.arguments);
logArguments("Application argument(s): ", applicationArguments.asArray());
}
private Map<String, String> determineEnvironmentVariables() {