mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-09-03 04:26:12 +08:00
Document the use of --args to pass arguments to bootRun
Closes gh-1176
This commit is contained in:
parent
ff8b8c55c6
commit
53372d5fd7
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user