Document the use of --args to pass arguments to bootRun

Closes gh-1176
This commit is contained in:
Andy Wilkinson 2018-09-06 13:08:40 +01:00
parent ff8b8c55c6
commit 53372d5fd7
2 changed files with 17 additions and 0 deletions

View File

@ -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

View File

@ -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='<arguments'>` 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