gpt4 book ai didi

java - 使用 Maven 将 EAR 归档到另一个 EAR 中?

转载 作者:行者123 更新时间:2023-12-01 11:19:18 26 4
gpt4 key购买 nike

你可以将一个耳朵文件放入另一个耳朵文件中吗?我尝试将 Ear 依赖项添加到 Ear 模块,指定 Artifact 类型为
<type>ear</type>
使用maven 3.3.3,但我得到
Failed to initialize ear modules: Unknown artifact type[ear]
如果我没有指定 Artifact 类型,那么 maven 会查找 jar Artifact ,但找不到它。有办法做到吗?如果不是,是否有理由禁止内耳文件?

最佳答案

EAR存档只能包含WAR , JARRAR (资源文件)模块。

如果您在 Maven 中有一个 EAR 项目,您应该像这样添加 EJB 依赖项:

<dependency>
<type>ejb</type>
<groupId>...</groupId>
<artifactId>...</artifactId>
<version>...</version>
</dependency>

并配置maven-ear-plugin类似地

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ear-plugin</artifactId>
<configuration>
...
<modules>
<ejbModule>
<groupId>...</groupId>
<artifactId>...</artifactId>
</ejbModule>
</modules>
</configuration>
</plugin>

对于WAR您需要使用 <type>war</type> 的依赖项和<webModule>相反。

关于java - 使用 Maven 将 EAR 归档到另一个 EAR 中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31450044/

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