diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/asciidoc/index.adoc b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/asciidoc/index.adoc index 47b602b5ce..82fb802dc5 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/asciidoc/index.adoc +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/asciidoc/index.adoc @@ -11,6 +11,7 @@ Andy Wilkinson :dependency-management-plugin-documentation: {dependency-management-plugin}/blob/master/README.md :gradle-userguide: https://docs.gradle.org/current/userguide :gradle-dsl: https://docs.gradle.org/current/dsl +:gradle-api: https://docs.gradle.org/current/javadoc :application-plugin: {gradle-userguide}/application_plugin.html :groovy-plugin: {gradle-userguide}/groovy_plugin.html :java-plugin: {gradle-userguide}/java_plugin.html diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/asciidoc/running.adoc b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/asciidoc/running.adoc index 164b40cfac..2feae28870 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/asciidoc/running.adoc +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/asciidoc/running.adoc @@ -42,6 +42,22 @@ include::../gradle/running/application-plugin-main-class-name.gradle[tags=main-c +[[running-your-application-passing-arguments]] +=== Passing arguments to your application +Like all `JavaExec` tasks, arguments can be passed into `bootRun` from the command line +using `--args='` when using Gradle 4.9 or later. For example, to run your +application with a profile named `dev` active the following command can be used: + +[source,bash,indent=0,subs="verbatim"] +---- + $ ./gradlew bootRun --args='--spring.profiles.active=dev' +---- + +See {gradle-api}/org/gradle/api/tasks/JavaExec.html#setArgsString-java.lang.String-[the +javadoc for `JavaExec.setArgsString`] for further details. + + + [[running-your-application-reloading-resources]] === Reloading resources If devtools has been added to your project it will automatically monitor your