0

我有两个 .Ear 文件,即 ABC.EAR 和 XYZ.EAR。

ABC.ear 对 XYZ.ear 中的一些 jar 有一些依赖关系。

  1. 我无法将它们打包到一个 .EAR 文件中。
  2. 我无法将使用的库放在 WildFly (WildFly\modules\system\layers\base) 的 lib 文件夹中。
4

1 回答 1

0

XYZ.ear 中的罐子。

如果 jar 是子部署,您可以在依赖 ear 中的 jboss-deployment-structure.xml 中指定依赖项。

例如 ABC.ear/META-INF/jboss-deployment-structure.xml:

<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure>
    <deployment>
        <dependencies>
            <module name="deployment.XYZ.ear.xxxx1.jar">   <!-- xxxx1.jar is a sub-deployement of XYZ.ear -->
                <imports>
                    <include path="**"/>
                </imports>
            </module>
            <module name="deployment.XYZ.ear.xxxx2.jar">   <!-- xxxx2.jar is a sub-deployement of XYZ.ear -->
                <imports>
                    <include path="**"/>
                </imports>
            </module>

            <!-- other dependencies here ... -->
        </dependencies>
    </deployment>
</jboss-deployment-structure>

您可以在 WF 管理控制台中查看 ear 的子部署列表:部署菜单 -> 选择 ear -> 子部署。

如果 jar 只是库(不是子部署),那么您应该能够将相同的库添加到 ABC.ear。

于 2019-11-27T21:04:21.433 回答