Commit e8b59b9e authored by Dave Syer's avatar Dave Syer

Add CLI command line arguments examples

parent e858cfcc
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment