Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multi Module Maven2 Project with WTP

I'm having a hard time to make my Maven2 multi module project, with a deep project structure, appear as a single ear (with its dependencies - which includes 1 war, 2 ejbs and 1 jar) to be deployed in my JBOSS 5 server inside my Eclipse Ganymede (tab Servers).

I've been trying to use Maven Eclipse Plugin to turn my projects into a WTP project without success. Therefore they appear to be deployed in the server they appear as separated projets.

My project has 1 war, 2 ejbs and 1 jar that must be packaged inside an ear, each of the "subprojects" is a separate module.

Project's pom.xml (type pom):

...

<modules>
   <module>ejb1</module>
   <module>ejb2</module>
   <module>war</module>
   <module>jar</module>
   <module>ear</module>
</modules>

...

The ear module is only responsable to pack the other modules together.

Is there a way to tell eclipse (ganymede) that all those projects (ejbs, war and jar) are inside the ear module so I can deploy the ear in the server?

like image 704
gege Avatar asked May 28 '09 17:05

gege


2 Answers

What you want to do is have maven create the eclipse projects via mvn eclipse:eclipse This might be helpful.

like image 174
sal Avatar answered Sep 21 '22 16:09

sal


try m2eclipse (google it) and install the WTP integration tool, create a project using the maven wizard, change the type to pom in the pom xml editor, create a sub modules from the pom and that adds it as child, if its a web project it get the WTP behavior i.e it can be deployed to a j2ee container ( jboss / tomcat ), add a dep to the web module for ejb module in the web pom etc, deploy the web app to the container

like image 31
ssmithstone Avatar answered Sep 20 '22 16:09

ssmithstone