How should I define Pom.xml in each Module so that web module can communicate with the other two ejb modules?
Posted
by
Kayser
on Programmers
See other posts from Programmers
or by Kayser
Published on 2012-08-30T13:27:38Z
Indexed on
2012/08/30
15:49 UTC
Read the original article
Hit count: 244
Maven, maven, maven. It must be very nice and it is nice by a small application.
Now I want to build an ear project: with two EJB Modules, a web Module and ear module to build an ear file. Web Module is dependent on the other ejb modules..
How should I define Pom.xml in each Module so that web module can communicate with the other two ejb modules in ear and the ear module builds the right ear file?
What I have done before:
Module 1 --> Basic Module. All other modules are dependent to this Module. Basic functionality like login etc.
<packaging>ejb</packaging>
Module 1 --> Data Module. All Entites are here Type EJB
<dependency>
<groupId>com.myCompnay</groupId>
<artifactId>Modul_Basic</artifactId>
<version>0.0.1-SNAPSHOT</version>
<type>ejb</type>
</dependency
Module 2 --> Business Module. Businnes Facades are here. Type EJB
<dependency>
<groupId>com.myCompnay</groupId>
<artifactId>Modul_Basic</artifactId>
<version>0.0.1-SNAPSHOT</version>
<type>ejb</type>
</dependency
Web Module -> Type is WAR
<dependency>
<groupId>com.myCompnay</groupId>
<artifactId>Modul_Basic</artifactId>
<version>0.0.1-SNAPSHOT</version>
<type>ejb</type>
</dependency
EAR Module --> In this project I try to build the project.
<packaging>ear</packaging>
<dependencies>
<dependency>
<groupId>com.myCompnay</groupId>
<artifactId>Modul_Basic</artifactId>
<version>0.0.1-SNAPSHOT</version>
<type>ejb</type>
</dependency
<dependency>
<groupId>com.myCompnay</groupId>
<artifactId>Modul_Business</artifactId>
<version>0.0.1-SNAPSHOT</version>
<type>ejb</type>
</dependency
<dependency>
<groupId>com.myCompnay</groupId>
<artifactId>Modul_WEB</artifactId>
<version>0.0.1-SNAPSHOT</version>
<type>war</type>
</dependency
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ear-plugin</artifactId>
</plugin>
</plugins>
</build>
© Programmers or respective owner