Prefer arguments in POM over spring-boot.run.arguments

This commit changes the order of precedence for the `arguments` property
of the AbstractRunMojo so that values specified in the POM override
values provided on the command line using `spring-boot.run.arguments`.
This brings the `arguments` property in line with all other Mojo
parameters.

Fixes gh-20024
This commit is contained in:
Scott Frederick
2020-02-07 14:35:42 -06:00
parent cc3eac898a
commit 625b40aa90
6 changed files with 80 additions and 2 deletions

View File

@@ -319,8 +319,8 @@ public abstract class AbstractRunMojo extends AbstractDependencyFilterMojo {
* @return a {@link RunArguments} defining the application arguments
*/
protected RunArguments resolveApplicationArguments() {
RunArguments runArguments = (this.commandlineArguments != null) ? new RunArguments(this.commandlineArguments)
: new RunArguments(this.arguments);
RunArguments runArguments = (this.arguments != null) ? new RunArguments(this.arguments)
: new RunArguments(this.commandlineArguments);
addActiveProfileArgument(runArguments);
return runArguments;
}