Pivotal Knowledge Base

Follow

VMware: How to determine a Grails war file environment

 

Purpose

Grails supports the concept of enviroments. To take advantage of these environments you can have different data source settings per environment or different config settings. When running a Grails application (run-app command) or building a WAR file, an environment can be specified. This article aims to provide information on how to find the environment a WAR file has been created with, analyzing the content of the WAR file only.

Resolution

One can have a look inside the archive, under [WAR_FILE]\WEB-INF\classes\application.properties.
This file contains an entry 'grails.env' that has different values depending on the environment the application has been built for. As an example of such file, please see below an entry for a "production" WAR file:
plugins.webflow=1.3.8
grails.buildScope=war
grails.war.deployed=true
app.version=0.1
plugins.tomcat=1.3.7
plugins.jquery=1.7.1
plugins.jquery-ui=1.8.15
app.servlet.version=2.4
plugins.hibernate=1.3.7
app.name=test
app.grails.version=1.3.7
grails.env=production


Additional Information

 
©VMware 2013

Comments

Powered by Zendesk