想要构建多模块 pom,该 pom 在 maven 中从同一项目构建 2 只耳朵



我有一个主要的PTC项目,里面有不同的模块(子项目)

PTC
|
+-- pom.xml
|    
+-- PrismaTestClientConfig
|    
+-- PrismaTestEarM
|  |  
|  -- pom.xml
|  
+-- PrismaTestClientHTMLGeneration
|  |  
|  -- pom.xml
|  
+-- PrismaTestClientWeb
|  |  
|  -- pom.xml
|  
+-- PrismaTestCommon
 
<modules>  
    <module>PrismaTestCommon</module>  
    <module>PrismaTestClientHTMLGeneration</module>  
    <module>PrismaTestClientWeb</module>  
    <module>PrismaTestClientEarM</module>  
</modules>  

所以我有一个常见的 pom.xml 的 PTC 包含上述模块依赖项:

上面的东西构建了ptc.ear

现在我想在BTCEarM上添加2个模块BTCHTMLGeneration,并使用PTC的PTCCommon和PTCWeb并构建btc.ear。此外,当我想构建 ptc.ear 时,它需要 4 个以上的模块,当我想构建 btc.ear 时,它应该从 PTC 中获取通用 2 个模块,从 BTC 中获取 2 个新模块

我怎样才能实现这一点...请帮忙

只需创建两个单独的模块 btc.ear(最好将它们命名为 btc-ear 或 ptc-ear),并将适当的依赖项添加到 ear 模块中。深入了解 maven-ear-plugin 文档。

最新更新