gpt4 book ai didi

java - 如何禁用特定 WAR 或 EAR 的应用程序服务器嵌入式库 (jar)?

转载 作者:行者123 更新时间:2023-11-28 22:05:37 26 4
gpt4 key购买 nike

有时您的项目中可能有一个第三方库,这可能会导致与您的server-embedded jars冲突。从应用程序服务器 lib 文件夹 中删除嵌入式 jar 可能会破坏其他已部署的应用程序。

有没有办法在 TomEE、JBoss、GlassFish 中只为一个项目禁用服务器嵌入的 jar?

enter image description here

最佳答案

在 JBoss 中,您可以使用 WEB-INF 目录中的 jboss-deployment-structure.xml 描述符禁用容器管理的库。

<jboss-deployment-structure>
<deployment>
<!-- Exclusions allow you to prevent the server from automatically adding
some dependencies -->
<exclusions>
<!-- This will cause the JBoss container to not provide your deployed
application's log4j dependencies. This way you can use an implementation
deployed with your artifact. -->
<module name="org.apache.log4j" />
</exclusions>
</deployment>
</jboss-deployment-structure>

可以找到 JBoss AS 7 中类加载的文档 here .

关于java - 如何禁用特定 WAR 或 EAR 的应用程序服务器嵌入式库 (jar)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18002444/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com