Add CLI command line arguments examples

This commit is contained in:
Dave Syer 2014-10-27 08:11:48 +00:00
parent e858cfcced
commit e8b59b9e55
1 changed files with 19 additions and 0 deletions

View File

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