Edit your Config.groovy file and add the following at the end:
grails.config.locations = [ "classpath:grails-app-config.properties"]
And then configure the production portion of your DataSource.groovy file like this:
environments { ... production { dataSource { dbCreate = "" driverClassName = "" url = "" username = "" password = "" } } }
Notice that we can set the properties as blanks. We will override the values later in a properties file.
Create the properties file. Below is the contents of grails-app-config.properties I created while testing this tutorial
dataSource.dbCreate=update dataSource.driverClassName=com.mysql.jdbc.Driver dataSource.url=jdbc:mysql://localhost:3306/myappdb dataSource.username=root dataSource.password=secretNotice that I am using MySQL as the database for my test. You may change the values as you see fit to your scenario. Make sure also that you have the JDBC driver in your application server, or include them in your war.
... common.loader=${catalina.base}/lib,${catalina.base}/lib/*.jar,${catalina.home}/lib,${catalina.home}/lib/*.jar,${catalina.home}/props ...Notice that we added a new folder at the end of the line. This will be included to the classpath.