From 2a90c3dea4ff47ecc2bdeab01e1118fa988d75a2 Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Tue, 11 Feb 2020 11:56:13 +0100 Subject: [PATCH 1/2] Fix broken smoke test See gh-19926 --- .../sample/liquibase/SampleLiquibaseApplicationTests.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spring-boot-samples/spring-boot-sample-liquibase/src/test/java/sample/liquibase/SampleLiquibaseApplicationTests.java b/spring-boot-samples/spring-boot-sample-liquibase/src/test/java/sample/liquibase/SampleLiquibaseApplicationTests.java index 9997e53575..5dcdb5e821 100644 --- a/spring-boot-samples/spring-boot-sample-liquibase/src/test/java/sample/liquibase/SampleLiquibaseApplicationTests.java +++ b/spring-boot-samples/spring-boot-sample-liquibase/src/test/java/sample/liquibase/SampleLiquibaseApplicationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -61,9 +61,9 @@ public class SampleLiquibaseApplicationTests { assertThat(output).contains("Successfully acquired change log lock") .contains("Creating database history " + "table with name: PUBLIC.DATABASECHANGELOG") .contains("Table person created") - .contains("ChangeSet classpath:/db/" + "changelog/db.changelog-master.yaml::1::" + .contains("ChangeSet classpath:db/" + "changelog/db.changelog-master.yaml::1::" + "marceloverdijk ran successfully") - .contains("New row inserted into person").contains("ChangeSet classpath:/db/changelog/" + .contains("New row inserted into person").contains("ChangeSet classpath:db/changelog/" + "db.changelog-master.yaml::2::" + "marceloverdijk ran successfully") .contains("Successfully released change log lock"); } From 765b2178d17d6abe1dd67c6e786ec80297ee8b75 Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Tue, 11 Feb 2020 13:39:10 +0100 Subject: [PATCH 2/2] Document spring-boot.run.arguments behaviour with multiple arguments Closes gh-19998 --- .../boot/maven/AbstractRunMojo.java | 4 +- .../site/apt/examples/run-arguments.apt.vm | 51 +++++++++++++++++++ .../src/site/apt/index.apt | 2 + .../src/site/site.xml | 1 + 4 files changed, 56 insertions(+), 2 deletions(-) create mode 100644 spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/site/apt/examples/run-arguments.apt.vm diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/AbstractRunMojo.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/AbstractRunMojo.java index b76a6e9588..98f53deac0 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/AbstractRunMojo.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/AbstractRunMojo.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -145,7 +145,7 @@ public abstract class AbstractRunMojo extends AbstractDependencyFilterMojo { * quotes. When specified, takes precedence over {@link #arguments}. * @since 2.2.3 */ - @Parameter(property = "spring-boot.run.arguments", readonly = true) + @Parameter(property = "spring-boot.run.arguments") private String commandlineArguments; /** diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/site/apt/examples/run-arguments.apt.vm b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/site/apt/examples/run-arguments.apt.vm new file mode 100644 index 0000000000..9569519dc8 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/site/apt/examples/run-arguments.apt.vm @@ -0,0 +1,51 @@ + ----- + Using Application Arguments + ----- + Stephane Nicoll + ----- + 2020-02-11 + ----- + + Application arguments can be specified using <<>>. The following sets two + arguments: <<>> and <<>>: + +--- + + ... + + + 42 + + ... + + ... + + ${project.groupId} + ${project.artifactId} + ${project.version} + + + property1 + property2=${my.value} + + + ... + + ... + + ... + + ... + +--- + + On the command-line, arguments are separated by a space the same way <<>> + are. If an argument contains a space, make sure to quote it. In the following example, + two arguments are available: <<>> and <<>>: + +--- +mvn spring-boot:run -Dspring-boot.run.arguments="property1 'property2=Hello World'" +--- + + + diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/site/apt/index.apt b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/site/apt/index.apt index 64cd7a049a..7058998d72 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/site/apt/index.apt +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/site/apt/index.apt @@ -58,6 +58,8 @@ Spring Boot Maven Plugin * {{{./examples/run-env-variables.html}Using environment variables}} + * {{{./examples/run-arguments.html}Using application arguments}} + * {{{./examples/it-random-port.html}Random port for integration tests}} * {{{./examples/it-skip.html}Skip integration tests}} diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/site/site.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/site/site.xml index 6711b55c15..11084a6fdb 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/site/site.xml +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/site/site.xml @@ -14,6 +14,7 @@ +