The generated Grails war file with all default jars is around 30 MB. I need to reduce this size for frequent test deployments to remote tomcat container. So I am trying to use the common libs Tomcat technique. The process is not working for some reason.
Here are the steps I am taking
- First I copied all jar files from web-inf/lib directory to the server's common directory as shown below
Here is /var/lib/tomcat7/conf/catalina.properties common.loader configuration.
- I then configured the Grails configuration as follows
- I then create war using
grails war --nojars
The generated war file was 6.42 mb.
Then I copied the war file to tomcat webapps directory.
When I access the webapp, I get "Page can't be found 404 error".
What am I doing wrong?
Update
Here is the error logged in catalina.out. The application was nojars.




Your best bet is to limit the dependencies; this can only be done through your build.gradle file AFAIK. Cut out the cruft to only what you need.
If you know a plugin is provided by another dependency, use 'provided'
Also, cut out double includes (like groovy-all) and other piecs you don't need:
Specifically declare the pieces that you need in your gradle.build and exclude the pieces you don't. You have to be smarter about the build is all.