This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Ant, Maven and Other Build Tools and the fly likes Packageing concept of Maven with Ejb Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Packageing concept of Maven with Ejb" Watch "Packageing concept of Maven with Ejb" New topic
Author

Packageing concept of Maven with Ejb

Kousik Majumder
Ranch Hand

Joined: Sep 30, 2007
Posts: 227
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.


Thanks in Advance,
Kousik
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5779
    
    7

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.


JBoss In Action
Kousik Majumder
Ranch Hand

Joined: Sep 30, 2007
Posts: 227
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

Joined: Jun 25, 2001
Posts: 15661
    
  15

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.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Packageing concept of Maven with Ejb
 
Similar Threads
eclipse galileo + m2eclipse + enterprise application
MAVEN EAR problem
initializing log4j in an ear file
EJB3 Dependency Injection confusion
Some Deployment Error. JBoss(4.2). Error code 404 displayed while running Project.