dudemonkey
dudemonkey

Reputation: 1100

How to build a custom environment in Grails

I'm trying to add a new environment to our Grails WAR (let's call it "staging"). I can manage the configuration in Config.groovy and DataSource.groovy and access the right configuration at run-time with -Dgrails.env, but how do I build this WAR?

The Grails documentation does not cover this case and the links on the page seem to be outdated.

Upvotes: 0

Views: 721

Answers (1)

tylerwal
tylerwal

Reputation: 1870

You are so very close to having the right combination in your question, this should work:

grails -Dgrails.env=staging war

Actually, the documentation for the war command even uses 'staging' as the environment used.

The same goes for any environment-specific command:

grails -Dgrails.env=<environment name> <command>

Upvotes: 2

Related Questions