Want to build multimodule pom which builds 2 ear from same project in maven

394 views Asked by At

I have one main PTC Project inside which I have different modules(sub projects)

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>  

So I have one common pom.xml of PTC which contains above dependency of module:

The above thing builds ptc.ear

Now I want to add 2 modules BTCHTMLGeneration on BTCEarM and use PTCCommon and PTCWeb from PTC and build btc.ear. Also when i want to build ptc.ear it takes above 4 module and when i want to build btc.ear , it shoud take common 2 module from PTC and 2 new module from BTC

How can I achieve this...Please help

1

There are 1 answers

0
khmarbaise On

Simply create two separate modules btc.ear (better name them btc-ear or ptc-ear) and add the appropriate dependencies to the ear modules. Take a deep look into the maven-ear-plugin documentation.