I'm about to deploy several grails apps on top of a single Tomcat server, and I have the following doubts:
Thanks
I think best practices are to keep the libraries in the war, because if you update a library that's shared then you have make sure it's compatible with all of your apps that are using it. We do this with grails and with spring in general that way we don't have to go back and do compatibility testing each time we upgrade.
Also I believe that tomcat loads an instance of the class per application so you don't save on memory by using it as a common class.
See also:
Does Tomcat load the same library file into memory twice if they are in two web apps?
1) putting the jars in shared/lib or common/lib might reduce the amount of memory required in PermGen. IMHO the greatest advantage is that uploading the war file is much more faster. But keep in mind, what TripWird said, shared jars ties all the deployed apps to the same grails version. Upgrading becomes a "nothing-or-all" game.
2) if you use
grails prod war --nojars
then all jar file are excluded from the war.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With