我们的项目的结构如下:
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-ejb
为ejbModule
mycomponent-web
为webModule
mycomponent-api
为jarModule
这可以按预期工作。但是:
是否可以通过利用mycomponent
-pom模块及其声明来实现相同的功能?因此,我们不需要再次单独列出这些模块?
如果我们将mycomponent
-pom作为依赖项添加,maven-ear-plugin
是否可以在内置的ear
内自动添加依赖项子模块(ejb,web,api)?