Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Do I need a parent project or will ear suffice

 
Tanya Ruttenberg
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic