在 EAR 的不同 WAR 中分离相同的 jar [英] Separate same jars in different WAR of a EAR

查看:34
本文介绍了在 EAR 的不同 WAR 中分离相同的 jar的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前我们面临一个问题.我们正在构建一个包含多个战争文件的耳朵.在 2 个 WAR 中包含相同的 jars.这两个战争在部署期间都需要这些 jar.所以我可以在 ANT 中有什么方法可以构建它,以便这些 jar 将在一个地方,并且不会在耳朵部署期间产生任何问题.

currently we are facing one problem. We are building a ear which contains multiple war files. In 2 of the WARs contains same jars. Both these wars need these jars during deployment.So Is there any way in ANT I can built it so that these jars will be in one single place and it will not create any problem during the ear deployment.

推荐答案

好吧,你可以用便携的方式做到:

well, you can do it the portable way:

将库 jars 放在 .ear 文件的根目录.
示例:

Place the library jars at the root of .ear file.
Example:

library jar -> lib1.jar, lib2.jar

[EAR STRUCTURE]
your.ear
|--yourfirst.war
|--yoursecond.war
|--lib1.jar
|--lib2.jar

更新两个 .war 文件中的 MANIFEST.MF 文件以指向这些 jar像这样:
类路径:lib1.jar lib2.jar
(如果这是清单中的最后一个条目,请不要忘记在上一行的末尾添加一个空格和一个换行符)

Update the MANIFEST.MF files in both the .war files to point to these jars like so:
Class-Path: lib1.jar lib2.jar
(dont forget to add a space and a newline character to the end of the above line if this is the last entry in the manifest)

这篇关于在 EAR 的不同 WAR 中分离相同的 jar的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆