Grails + Eclipse Quick Tip #1
More Automated Builds
here is a little hint on how to make building your Grails apps from within Eclipse a little less explicit. The goal is to avoid being asked to manually issue a “grails package” after each re-build. Plus, if you followed my hints on how to let Grails and Eclipse compile to the same directory structure, you won’t need to issue “grails clean” anymore. Simply running Project –> Clean… and then running the Grails launcher will suffice for successful compilation and deployment if you follow these instructions.
- Go to you project properties and select the Builders entry. You should see two builders: Groovy builder and Java builder.
- If you haven’t yet configured an external tools launcher for a “grails package”, click New…, otherwise import that builder
- If you have to create the builder, set the following fields:
- set Location to the folder where the Grails executables reside on your system
- set Working Directory to ${workspace_loc:/your_project_name}
- set Arguments to “package”
- In the Build Options tab, check the fields After a “Clean” and During manual builds
- move the new builder to the bottom
I would also advice to create a keyboard shortcut to issue a manual build. For myself, I reassigned Ctrl+B to “Build project” instead of “Build all”.
When you now “Clean” your project and run the “run-app” launcher (I assume you have one!), Eclipse will first build your project and package it for deployment. The packaging is conditional though: if the sources are up-to-date, the new builder will be excluded when launching the app.
leave a comment