Looking for step-by-step guide to build and deploy Grails war to Tomcat

I've spent a bit of time, probably more than should be necessary, looking for a step-by-step guide to build and deploy a Grails war to a local instance of Tomcat using IntelliJ IDEA 13.
I've seen links talking about creating a run configuration for Tomcat, creating an artifact for my Grails app, plus other bits of pieces of information but nothing that puts it all together.  And I've seen nothing in the IntelliJ IDEA online documentation that describes how to do this.

Ideally, what I want is a single run / debug configuration that does this:

  1. Builds the war using grails war (optionally allows me to set the desired environment: dev test prod)
  2. Deploys the war to my local Tomcat instance
  3. Starts Tomcat (optionally in debug mode so that I can remote attach and debug my Grails app)
  4. Starts my browser of choice and points it at a URL inside my Grails app that I can configure

Can someone point me to a link that lays this out relatively simply?

1 comment
Comment actions Permalink

By default IntelliJ creates a configuration that runs (or debugs) the Grails app in-place. That's what most people want while developing. You can copy that configuration and add '-Dgrails.env=test' in front of the 'run-app' line to run the app under different environments.

If for some reason you want to run a _war_ file (which I wouldn't recommend since changes aren't going to be reflected in the app until you rebuild) then you'll have to delve into running 'grails war' before each run or debug and create run or debug configurations that point to a local Tomcat instance. In other words, its a pain and I don't know why you want to do that.


Please sign in to leave a comment.