Skip to content

Commit 53372d5

Browse files
committed
Document the use of --args to pass arguments to bootRun
Closes gh-1176
1 parent ff8b8c5 commit 53372d5

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/asciidoc/index.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Andy Wilkinson
1111
:dependency-management-plugin-documentation: {dependency-management-plugin}/blob/master/README.md
1212
:gradle-userguide: https://docs.gradle.org/current/userguide
1313
:gradle-dsl: https://docs.gradle.org/current/dsl
14+
:gradle-api: https://docs.gradle.org/current/javadoc
1415
:application-plugin: {gradle-userguide}/application_plugin.html
1516
:groovy-plugin: {gradle-userguide}/groovy_plugin.html
1617
:java-plugin: {gradle-userguide}/java_plugin.html

spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/asciidoc/running.adoc

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,22 @@ include::../gradle/running/application-plugin-main-class-name.gradle[tags=main-c
4242

4343

4444

45+
[[running-your-application-passing-arguments]]
46+
=== Passing arguments to your application
47+
Like all `JavaExec` tasks, arguments can be passed into `bootRun` from the command line
48+
using `--args='<arguments'>` when using Gradle 4.9 or later. For example, to run your
49+
application with a profile named `dev` active the following command can be used:
50+
51+
[source,bash,indent=0,subs="verbatim"]
52+
----
53+
$ ./gradlew bootRun --args='--spring.profiles.active=dev'
54+
----
55+
56+
See {gradle-api}/org/gradle/api/tasks/JavaExec.html#setArgsString-java.lang.String-[the
57+
javadoc for `JavaExec.setArgsString`] for further details.
58+
59+
60+
4561
[[running-your-application-reloading-resources]]
4662
=== Reloading resources
4763
If devtools has been added to your project it will automatically monitor your

0 commit comments

Comments
 (0)