Proper use of grails:exec

Whilst trying to run mvn grails:exec with more complicated requests it kept erroring:


Chill:superted idimmu$ mvn grails:exec -Dcommand="jack-be-nimble net.idimmu User Profile"
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'grails'.
[INFO] ------------------------------------------------------------------------
[INFO] Building Unnamed - net.idimmu:gymlife:war:1.0-SNAPSHOT
[INFO] task-segment: [grails:exec] (aggregator-style)
[INFO] ------------------------------------------------------------------------
[INFO] [grails:exec]
[INFO] Using Grails 1.2.0
Running pre-compiled script
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Unable to start Grails

Embedded error: java.lang.reflect.InvocationTargetException
[INFO] ————————————————————————
[INFO] For more information, run Maven with the -e switch
[INFO] ————————————————————————
[INFO] Total time: 14 seconds
[INFO] Finished at: Thu Jan 07 22:49:41 GMT 2010
[INFO] Final Memory: 32M/81M
[INFO] ————————————————————————

After some playing about, I finally found the correct runes


Chill:superted idimmu$ mvn grails:exec -Dcommand="jack-be-nimble" -Dargs="net.idimmu User Profile"
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'grails'.
[INFO] ------------------------------------------------------------------------
[INFO] Building Unnamed - net.idimmu:superted:war:1.0-SNAPSHOT
[INFO] task-segment: [grails:exec] (aggregator-style)
[INFO] ------------------------------------------------------------------------
[INFO] [grails:exec]
[INFO] Using Grails 1.2.0

Running script /Users/idimmu/Documents/stsworkspace/superted/plugins/nimble-0.3-SNAPSHOT/scripts/JackBeNimble.groovy
Environment set to development
Using package net.idimmu to create custom classes
Setting up nimble with custom User domain class: User
Setting up nimble with custom Profile domain class: Profile
[echo] Jack be nimble
[echo] Jack be quick
[echo] Jack jump over
[echo] The candlestick.
[copy] Copying 1 file to /Users/idimmu/Documents/stsworkspace/superted/grails-app/conf
[copy] Copying 1 file to /Users/idimmu/Documents/stsworkspace/superted/grails-app/conf
[copy] Copying 1 file to /Users/idimmu/Documents/stsworkspace/superted/grails-app/conf
[mkdir] Created dir: /Users/idimmu/Documents/stsworkspace/superted/grails-app/domain/net/idimmu
[copy] Copying 15 files to /Users/idimmu/Documents/stsworkspace/superted/grails-app/views/templates/nimble
[mkdir] Created dir: /Users/idimmu/Documents/stsworkspace/superted/src/sass
[copy] Copying 1 file to /Users/idimmu/Documents/stsworkspace/superted/src/sass
[copy] Copying 1 file to /Users/idimmu/Documents/stsworkspace/superted/src/sass
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 16 seconds
[INFO] Finished at: Thu Jan 07 22:56:52 GMT 2010
[INFO] Final Memory: 41M/81M
[INFO] ------------------------------------------------------------------------

Woo hoo!

Leave a Reply

Your email address will not be published. Required fields are marked *