tags:

views:

149

answers:

4

Hi, is there a way to use Grails in "exploded" mode on tomcat in order to make individual changes in a running application (like a gif) without having to regenerate the entire war and upload it ?

Something like adding an xml file in tomcat's conf/Catalina/localhost that points to an exploded grails application ?

Thanks in advance.

+2  A: 

Not sure what you mean here, but tomcat will explode the war when it detects a new one, in which case you could modify the files directly in the exploded directory. I wouldn't really recommend this though as once you upload a new version of the war all of your changes will be lost.

Flash84x
And will the changes also be lost when restarting the server ?
xain
From my experience the default behavior of Tomcat won't explode the war again unless the war itself is updated.
Flash84x
changed a title in a gsp file in the deployed directory, but the change wasn't applied when calling the page. Any cache to clear maybe?
xain
A: 

Isn't that what happens when you execute grails run-app?

Daniel
Right, but my production server is in the cloud and sometimes takes too long to upload 50Mb just because there's an change in a gif or a gsp.
xain
A: 

How do you access your Server in the Cloud? With tomcat simply create directory with the expanded war in it (without the war extention) in your WebApps directory.

If you want to Grails to leave and expanded war behind rather than the .War file then change the War.groovy script in your Grails distribution to not delete the directory at the end.

Hope this helps.

Scott Warren
A: 

My piece of advice : store your static resources in a different server.

I see that you are deploying your app in a cloud computing environment. If EC2 is your platform then put all of your static resources (images, css, html...) in S3. Your pages will display faster (especially if you use CloudFront) AND your WAR file will be smaller (less time to upload/deploy) AND you will be able to change static resources as often as you wish.

fabien7474