2.12 Creating Artefacts
Grails ships with a few convenience targets such as create-controller, create-domain-class and so on that will create controllers and different artefact types for you.NOTE: These are just for your convenience and you can just as easily use an IDE or your favourite text editor.For example to create the basis of an application you typically need a domain model:
grails create-app helloworld
cd helloworld
grails create-domain-class book
This will result in the creation of a domain class at grails-app/domain/helloworld/Book.groovy
such as:
package helloworld
class Book {
}
There are many such create-*
commands that can be explored in the command line reference guide.
To decrease the amount of time it takes to run Grails scripts, use the interactive mode. |