[英]WEB-INF/lib directory vs. Java 9 modules
The WEB-Inf/lib directory of a web application is for jar files, which a servlet-container (eg Tomcat) takes automatically into the classpath of the application. Web 应用程序的 WEB-Inf/lib 目录用于存放 jar 文件,servlet 容器(例如 Tomcat)会自动将其放入应用程序的类路径中。 Are there any ideas how this mechanism works (or should work in the future) for modularized jars of Java 9?对于 Java 9 的模块化 jar,这种机制如何工作(或将来应该工作)有什么想法吗? These provide modules, where the user must specify which contained/exported modules/package should be used by the application.这些提供模块,用户必须指定应用程序应使用哪些包含/导出的模块/包。 There is a module path additionally to the (old) classpath.除了(旧)类路径之外,还有一个模块路径。
Does a modularized jar work without any further specifications/configurations such that all exported or contained modules are on the classpath then?模块化 jar 是否可以在没有任何进一步规范/配置的情况下工作,以便所有导出或包含的模块都在类路径上?
Java EE 8 and Tomcat 9 are released. Java EE 8 和 Tomcat 9 已发布。 Both projects claim to support Java 9. Thus, there should be a way to use Java 9 modules in a manner that complies to the modules idea.这两个项目都声称支持 Java 9。因此,应该有一种方法以符合模块思想的方式使用 Java 9 模块。
While Tomcat doesn't support running modular wars, you can take a look at Piranha Cloud.虽然 Tomcat 不支持运行模块化战争,但您可以查看 Piranha Cloud。
The Piranha Server itself can run in the module path and can deploy WARs in a new JPMS layer, respecting the module-info.class provided. Piranha Server 本身可以在模块路径中运行,并且可以在新的 JPMS 层中部署 WAR,尊重提供的 module-info.class。
https://piranha.cloud/blog/2021/20210128_Modular_applications_with_JPMS https://piranha.cloud/blog/2021/20210128_Modular_applications_with_JPMS
Disclaimer: I'm a Piranha Cloud developer免责声明:我是 Piranha Cloud 开发人员
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.