Maven 是否可以组合多个耳朵进行部署?
我们在SOA层中有12个ear文件,我们将这些ear分别部署到JBoss。我们越来越难以管理依赖项,以及所有这些EAR文件的部署 每只耳朵是:Maven 是否可以组合多个耳朵进行部署?,maven,ear,maven-ear-plugin,Maven,Ear,Maven Ear Plugin,我们在SOA层中有12个ear文件,我们将这些ear分别部署到JBoss。我们越来越难以管理依赖项,以及所有这些EAR文件的部署 每只耳朵是: 使用Maven和Maven ear插件构建 包含一个用于RESTful访问的webModule,如支付系统/支付系统 有一个类似payment-API-1.1.9.jar的API,它通常依赖于其他EAR 使用maven版本号,如payment-service-1.1.9.ear 理想情况下,我们可以有一个EAR(或其他格式),我们可以一起进行版本和认证。
如果答案是否定的,那么对于我们的架构是否“做错了”有什么想法吗?我们应该合并这些项目吗?用其他方法解决API依赖性问题?对我来说,听起来您应该使用带有多个web模块的单ear。见官方文件: 由于您仍将使用SOA,web服务可以通过定义的任何接口相互通信,因此部署可以大大简化 您的项目
pom.xml
s可能如下所示:
WebModuleA与pom.xml
类似:
<groupId>???</groupId>
<artifactId>webModuleA</artifactId>
<version>???</version>
<type>war</type>
<dependencies>
<dependency>
<groupId>???</groupId>
<artifactId>payment-service</artifactId>
<version>1.1.9</version>
<type>jar</type>
</dependency>
...
<groupId>???</groupId>
<artifactId>webModuleB</artifactId>
<version>???</version>
<type>war</type>
<dependencies>
<dependency>
<groupId>???</groupId>
<artifactId>payment-service</artifactId>
<version>1.1.9</version>
<type>jar</type>
</dependency>
...
<groupId>???</groupId>
<artifactId>payment-service</artifactId>
<version>1.1.9</version>
<type>jar</type>
...
支付服务与pom.xml
类似:
<groupId>???</groupId>
<artifactId>webModuleA</artifactId>
<version>???</version>
<type>war</type>
<dependencies>
<dependency>
<groupId>???</groupId>
<artifactId>payment-service</artifactId>
<version>1.1.9</version>
<type>jar</type>
</dependency>
...
<groupId>???</groupId>
<artifactId>webModuleB</artifactId>
<version>???</version>
<type>war</type>
<dependencies>
<dependency>
<groupId>???</groupId>
<artifactId>payment-service</artifactId>
<version>1.1.9</version>
<type>jar</type>
</dependency>
...
<groupId>???</groupId>
<artifactId>payment-service</artifactId>
<version>1.1.9</version>
<type>jar</type>
...
???
如果有些建议不清楚或不准确,请随时详细询问。谢谢Peter。我喜欢你带着这个去哪里。让我试一试,如果成功的话,我当然会接受答案。非常感谢彼得。这非常接近于我要讨论的最终解决方案。构建模块的父级,然后是包含所有依赖项的EAR pom和带有多个webModule的EAR插件。父级是在实际项目中包含其他模块,还是父级基本上看起来像一个空项目,带有pom文件,在运行构建时构建模块?我正在尝试做一些类似的事情,但我不知道除了像Peter演示的那样将其他模块作为模块和依赖项添加到pom中之外,如何包括它们。我对这有点陌生。