Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Packageing concept of Maven with Ejb

 
Kousik Majumder
Ranch Hand
Posts: 239
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I am new to maven. I am using Maven 2.0
I am confused when packaging an Ejb application with maven.
In some sites I am seeing that in the root folder other than ejb or war there is another folder(or module) called ear.
My question why there is a ear module in the root folder whereas my root folder's goal is to make an ear ?

Please help.
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm a little confused. By "root folder" are you implying that you have parent and child POMs, and that by "root folder" you really mean "parent POM"? Perhaps describing your POMs in a little more detail (how many you have, what artifact each is building) would help.
 
Kousik Majumder
Ranch Hand
Posts: 239
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See, ultimately my goal is to make an .ear file. Right.
So according to my understanding I should have the below project structure which will give me the .ear file:

myproject\pom.xml
myproject\war\pom.xml
myproject\war\src
myproject\ejbs\pom.xml
myproject\ejbs\src

Here 'myproject' refers to root folder and is responsible for making .ear file. Also tell me when a src folder should be added in root folder.
Please clear my understanding.



 
Tim Holloway
Saloon Keeper
Pie
Posts: 18164
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For an EAR, you'd generally have a project with dependent projects. The root project would be the controlling one and each of the child projects would be responsible for assembling some component. Each WAR and EJB jar would be a child project, for example. An EAR child project would then be responsible for collecting them all together and creating an EAR.

The root project shouldn't need a src directory, nor should the EAR child. You only need a src directory if you have source code to compile or include into the artifact being produced. In the case of an EAR project, all the inputs would probably be dependencies. If the EAR manifest files are dynamically created, there's no need for src. Only if you're providing a static manifest or a template would you need a src directory structure to keep it in.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic