File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Ant, Maven and Other Build Tools and the fly likes Do I need a parent project or will ear suffice Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Do I need a parent project or will ear suffice" Watch "Do I need a parent project or will ear suffice" New topic

Do I need a parent project or will ear suffice

Tanya Ruttenberg
Ranch Hand

Joined: Jun 22, 2009
Posts: 40
We are converting our seam jboss tools-based projects into maven projects.

My colleague did the initial research and conversion.

JBoss tools generates 3 projects when you create a seam project: web, ear, and ejb projects. We preserved that structure and created 3 maven projects proj-web, proj-app, and proj-ear. He also created a proj-parent maven project to tie them together.

It seems to me that the task of the parent project, to tie all project together, is redundant to the task of the EAR project, proj-app, which creates an ear file containing the ejb jar and war files.

Furthermore, he designed all this on the command line and it's my job to figure out how to use it all in eclipse. The parent project set up does not play well in eclipse. I see no point to the parent project when "mvn install" on the app project builds the ear.

When does one really need a parent project? In this case isn't it redundant?
Peter Johnson

Joined: May 14, 2008
Posts: 5852

Personally, I would not set up a master (aka parent) project. In a way the ear project is the "master" project since it requires the other two to be built before it can be built. The only real reason to do a master project is to be able to enter a single command at the command line and have everything built. If you use a CI tool such as Jenkins, it will automatically recognize that your ear project depends on the app and web projects and thus if either of them needs to be rebuilt, it will also rebuild the ear.

By the way, the app, web and ear projects can still reference a parent POM (via coordinates, not via a relative path) to include common information (always a good practice). However, the parent POM does not have to reference the child projects as submodules. The two concepts are different and don't have to be used in conjunction.

JBoss In Action
I agree. Here's the link:
subject: Do I need a parent project or will ear suffice
It's not a secret anymore!