从多模块pom构建EAR

时间:2019-09-24 11:55:29

标签: maven java-ee pom.xml ear parent-pom

我们的项目的结构如下:

rootmodule(pom)
-->submodule1(pom)
---->submodule1-ear(ear)
---->submodule1-ejb(ejb)
---->submodule1-war(war)
-->submodule2(pom)
----> ...
-->mycomponent(pom)
---->mycomponent-api(jar)
---->mycomponent-ejb(ejb)
---->mycomponent-web(war)

mycomponent-模块始终在某些submodules中使用。

我们在submodule1-ear中添加以下模块声明:

  • mycomponent-ejbejbModule
  • mycomponent-webwebModule
  • mycomponent-apijarModule

这可以按预期工作。但是:

是否可以通过利用mycomponent-pom模块及其声明来实现相同的功能?因此,我们不需要再次单独列出这些模块?

如果我们将mycomponent-pom作为依赖项添加,maven-ear-plugin是否可以在内置的ear内自动添加依赖项子模块(ejb,web,api)?

0 个答案:

没有答案