Skip to content

Commit

Permalink
Introduce args field to map spring-boot.run.arguments system prop…
Browse files Browse the repository at this point in the history
…erty.
  • Loading branch information
nosan committed Oct 25, 2019
1 parent 79377a6 commit 5de47fb
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 129 deletions.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
invoker.mavenOpts=-Dspring-boot.run.arguments='--management.endpoints.web.exposure.include=prometheus,info,health,metrics,--spring.profiles.active=foo,bar'
invoker.systemPropertiesFile=test.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
spring-boot.run.arguments=--management.endpoints.web.exposure.include=prometheus,info,health,metrics --spring.profiles.active=foo,bar
Original file line number Diff line number Diff line change
Expand Up @@ -133,13 +133,20 @@ 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. On command line use spaces to
* separate multiple arguments and make sure to wrap multiple values between quotes.
* @since 1.0.0
*/
@Parameter(property = "spring-boot.run.arguments")
@Parameter
private String[] arguments;

/**
* Arguments from command line that should be passed to the application.
* @since 2.2.1
*/
@Parameter(property = "spring-boot.run.arguments", readonly = true)
private String args;

/**
* The spring profiles to activate. Convenience shortcut of specifying the
* 'spring.profiles.active' argument. On command line use commas to separate multiple
Expand Down Expand Up @@ -311,8 +318,8 @@ protected abstract void runWithMavenJvm(String startClassName, String... argumen
* @return a {@link RunArguments} defining the application arguments
*/
protected RunArguments resolveApplicationArguments() {
ApplicationArguments applicationArguments = new ApplicationArguments(this.arguments);
RunArguments runArguments = new RunArguments(applicationArguments.asArray());
RunArguments runArguments = (this.args != null) ? new RunArguments(this.args)
: new RunArguments(this.arguments);
addActiveProfileArgument(runArguments);
return runArguments;
}
Expand Down

This file was deleted.

This file was deleted.

0 comments on commit 5de47fb

Please sign in to comment.