Search code examples
grailsshared-librariestomcat8grails3grails-3.2

How to deploy multiple Grails 3.x applications in Tomcat 8 with shared jars?


I want to deploy few Grails 3.x web applications in Tomcat 8 with all commons jars in a tomcat/shared/lib directory.

Found similar question How to deploy multiple applications in Tomcat, share jars and have different datasources? but this is having information about Grails 1.x and 2.x versions?

Can someone help me with Grails 3.x and Tomcat 8+ versions?


Solution

  • With lot of research, I finally found a way to have shared libraries for Grails 3 app deployment on Tomcat 8.5.x.

    I have explored the resources element in Tomcat context.xml and where we can add external Jars to webapp classloader using JarResources tag. This way we can have all jars in one shared location and all applications having them in webapp class loader.

    https://tomcat.apache.org/tomcat-8.5-doc/config/resources.html - Follow this link for more info.