21.1 Standalone

"grails run-app"

You should be very familiar with this approach by now, since it is the most common method of running an application during the development phase. An embedded Tomcat server is launched that loads the web application from the development sources, thus allowing it to pick up any changes to application files.

You can run the application in the production environment using:

  1. grails prod run-app

You can run the app using the bootRun Gradle task. The next command uses the Gradle Wrapper.

./gradlew bootRun

You can specify an environment supplying grails.env system property.

./gradlew -Dgrails.env=prod bootRun

Runnable WAR or JAR file

Another way to deploy in Grails 3.0 or above is to use the new support for runnable JAR or WAR files. To create runnable archives, run grails package:

  1. grails package

Alternatively, you could use the assemble Gradle task.

./gradlew assemble

You can then run either the WAR file or the JAR using your Java installation:

  1. java -Dgrails.env=prod -jar build/libs/mywar-0.1.war (or .jar)

A TAR/ZIP distribution

Note: TAR/ZIP distribution assembly has been removed from Grails 3.1.