PurposeExecute Groovy script(s) in the context of a Grails environment.
Groovy scripts intended to be executed this way cannot be located in
src/main/scriptsbecause that directory is reserved for CLI scripts created by create-script.
The paths are resolved relative to the base project path
// 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 a single script in the dev environment and don't run Bootstrap grails run-script scripts/helloWorld.groovy// run with Gradle ./gradlew runScript -Pargs="scripts/helloWorld.groovy" -Dgrails.env=prod
grails [env]* run-script [scripts]
scripts- Which scripts to run
ctxvariable 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 (