Deploy a Grails 2.1.1 application to Tomcat as an

2020-07-18 05:54发布

问题:

I'm trying to deploy a Grails app on OpenShift, and I'm trying to avoid pushing a 50MB file across the web for every change.

I created a project at ~/dev/apps/grails/test to test it

Based on this answer on SO, I added

grails.war.exploded=true

to grails-app/conf/BuildConfig.groovy, which caused this folder to be created:

/home/sas/.grails/2.1.1/projects/test/stage

how can I tell it to create the exploded war at ~/dev/apps/grails/test/target/test-0.1?

copying the folder like this:

cp -r /home/sas/.grails/2.1.1/projects/test/stage ~/dev/tomcat/webapps/test-0.1 

works ok, but I'm trying to automate the whole process to come up with a quickstart script for OpenShift.

回答1:

Just had a look at the source code at grails/scripts/_GrailsWarPlugin.groovy

Just had to add

grails.project.war.exploded.dir = "target/${appName}-${appVersion}"
grails.war.exploded=true

to grails-app/conf/BuildConfig.groovy