From e8b59b9e550adfb8154944492bed75aefbdf47b9 Mon Sep 17 00:00:00 2001 From: Dave Syer Date: Mon, 27 Oct 2014 08:11:48 +0000 Subject: [PATCH] Add CLI command line arguments examples --- .../src/main/asciidoc/spring-boot-cli.adoc | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/spring-boot-docs/src/main/asciidoc/spring-boot-cli.adoc b/spring-boot-docs/src/main/asciidoc/spring-boot-cli.adoc index dd6316286e..16b0410998 100644 --- a/spring-boot-docs/src/main/asciidoc/spring-boot-cli.adoc +++ b/spring-boot-docs/src/main/asciidoc/spring-boot-cli.adoc @@ -80,6 +80,7 @@ is completely self-contained so you don't need any external Groovy installation. Here is an example ``hello world'' web application written in Groovy: +.hello.groovy [source,groovy,indent=0,subs="verbatim,quotes,attributes"] ---- @RestController @@ -93,7 +94,25 @@ Here is an example ``hello world'' web application written in Groovy: } ---- +Then +---- +$ spring run hello.groovy +---- + +To pass command line arguments to the application, you need to use a +"--" to separate them from the "spring" command arguments, e.g. + +---- +$ spring run hello.groovy -- --server.port=9000 +---- + +and to set JVM command line arguments you can use the `JAVA_OPTS` +environment variable, e.g. + +---- +$ JAVA_OPTS=-Xmx1024m spring run hello.groovy +---- [[cli-install-uninstall]] === Adding dependencies to the CLI