如何使用共享 jar 在 Tomcat 8 中部署多个 Grails 3.x 应用程序?

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

我想在 Tomcat 8 中部署几个 Grails 3.x web 应用程序,所有公共 jar 都在 tomcat/shared/lib 目录中。

找到了类似的问题 How to deploy multiple applications in Tomcat, share jars and have different datasources?,但这是关于 Grails 1.x 和 2.x 版本的信息?

有人可以帮助我使用 Grails 3.x 和 Tomcat 8+ 版本吗?

经过大量研究,我终于找到了一种在 Tomcat 8.5.x.

上为 Grails 3 应用程序部署共享库的方法

我探索了 Tomcat context.xml 中的资源元素,我们可以在其中使用 JarResources 标记将外部 Jar 添加到 webapp classloader。这样我们就可以将所有 jar 放在一个共享位置,并且所有应用程序都将它们放在 webapp class 加载器中。

https://tomcat.apache.org/tomcat-8.5-doc/config/resources.html - 关注此 link 了解更多信息。