$ grails create-app bookstore
$ cd bookstore
create-app
Description
The create-app
command serves as the initial step in Grails application development. When invoked, this command generates a Grails application with a user-specified name. Subsequently, it creates a subdirectory based on the provided application name within the directory where the command is executed.
In Grails 7,
Forge-specific flags will result in an error if used with the Shell CLI. |
Usage
This uses the Shell CLI to create a standard Grails application in a new bookstore
folder.
This uses the Forge CLI to generate an application with extended configuration options.
$ grails -t forge create-app bookstore \
--jdk=17 \
--gorm=hibernate \
--servlet=tomcat \
--test=spock \
--features=asciidoctor,github-workflow-java-ci
Options (Forge CLI)
These options are available only when using grails -t forge
:
-
NAME
: The desired name for the application. -
-f, --features=FEATURE[,FEATURE…]
: Enable features likegorm-hibernate5
,postgres
,asciidoctor
,grails-gsp
, etc. -
-g, --gorm=GORM Implementation
: Choose GORM implementation:hibernate
,mongodb
,neo4j
. -
--jdk=<javaVersion>
: Target JDK version (e.g., 11 or 17). -
-s, --servlet=Servlet Implementation
: Choose embedded servlet:tomcat
,jetty
,undertow
,none
. -
-t, --test=TEST
: Select test framework:spock
,junit
. -
-i, --inplace
: Create app in current directory.
Shell CLI Support
The following minimal flags are supported with the Shell CLI (grails
):
$ grails create-app bookstore
$ grails create-app --inplace
Available flags:
- --inplace
- --features
(limited support depending on profile)
- --profile
Forge-only options such as --jdk
, --gorm
, or --servlet
are not supported in the Shell CLI.
Examples
-
Create an app using the Shell CLI:
$ grails create-app bookstore $ cd bookstore
-
Create an app using the Forge CLI with advanced options:
$ grails -t forge create-app bookstore \ --jdk=17 \ --gorm=hibernate \ --features=asciidoctor,grails-gsp
-
Create an app in the current directory (both CLIs):
$ mkdir bookstore $ cd bookstore $ grails create-app --inplace
or
$ grails -t forge create-app --inplace