Upgrading Grails application to use Maven

If you want to upgrade Grails project to use Maven, all you need is Maven 2 installed.
Go to your project root and follow the steps:

If you are a Windows user, run

This is need because default maven options are not enough to run Grails environment.
2. run

Here instead of grails-maven-plugin:x.x.x specify your Grails version and in -DgroupId parameter write your identifier of group. For me it looks like:

As the result pom.xml  and src/main/webapp/WEB_INF/web.xml will be created.

3. change target JDK version to 1.6


4. run

mvn -Dgrails.env=prod install

or set environment in pom.xml like this:


If you try to run without -Dgrails.env=prod or grails.env property is not set in pom.xml your build will be created with development environment(default).

This command will build a war file in target/. Try it on your webapp container.

All done.

See more info about Grails+Maven here.