// run a single script in the dev environment grails run-script scripts/helloWorld.groovy // run multiple scripts in the prod environment grails prod run-script scripts/hello.groovy scripts/world.groovy // run with Gradle ./gradlew runScript -Pargs="scripts/helloWorld.groovy" -Dgrails.env=prod
Execute Groovy script(s) in the context of a Grails environment.
Groovy scripts intended to be executed this way cannot be located in
The paths are resolved relative to the base project path
grails <<env>>* run-script <<scripts>>
scripts- Which scripts to run
ctx variable is injected into all scripts and is an instance of the
Scripts are executed in the context of a persistent session. The default package is imported by default (