简体   繁体   English

WEB-INF/lib 目录与 Java 9 模块

[英]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 开发人员

Tomcat 9支持java 9

Also as per the stack over flow post - here , Tomcat 9 compatible with java 9 and given the configuration step also. 另外根据堆栈过流帖 - 这里 ,Tomcat 9兼容java 9并且还给出了配置步骤。

在此输入图像描述

Tomcat server compatible versions - link Tomcat服务器兼容版本 - 链接

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 / WEB-INF / classes vs / WEB-INF / lib - /WEB-INF/classes vs /WEB-INF/lib 动态Web项目:“java.lang.ClassNotFoundException”尽管WEB-INF / lib目录中的.jar文件 - dynamic web project: “java.lang.ClassNotFoundException” despite .jar file in the WEB-INF/lib directory java.lang.NoClassDefFoundError:即使jar存在WEB-INF / lib目录,org / json / JSONObject - java.lang.NoClassDefFoundError: org/json/JSONObject eventhough jar present WEB-INF/lib directory Java,Tomcat-运行时可以从WEB-INF / lib目录中加载资源吗? - Java, Tomcat - Can you load a resource during run-time from the WEB-INF/lib directory? MyEclipse不会将jar部署到WEB-INF / lib目录中 - MyEclipse does not deploy jars into WEB-INF/lib directory Maven将Tomcat JAR复制到webapp WEB-INF / lib目录 - Maven copying Tomcat JARs into webapp WEB-INF/lib directory 在tomcat类路径中包含web-inf / lib中的目录 - Including a directory inside web-inf/lib in tomcat classpath 可以从WEB-INF \\ lib \\ {*。jar} \\ META-INF \\ resources \\ WEB-INF目录访问tld文件吗? - Can tld files be accessed from WEB-INF\lib\{*.jar}\META-INF\resources\WEB-INF directory? Java jar文件正在WEB-INF / lib文件夹中删除 - java jar files are being deleted in the WEB-INF/lib folder JBOSS订购WEB-INF / lib的内容 - JBOSS ordering of contents of WEB-INF/lib
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM