import as existing maven project

gudii9
gudii9 used Ask the Experts™
on
hi,

while importing as existing maven project i see some projects have single pom.xml some other projects have top level pom and also sub level pom.xml as well. why we need like parent pom and child pom kind of structure for some projects?
please advise
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
IT Business Systems Analyst / Software Developer
Top Expert 2015
Commented:
Sometimes an application is best structured as a number of individual "projects", be it because it is very big or other considerations. But often, each project requires settings that are common to the entire group of projects. The parent/child pom structure is used to support this. You can put common settings, dependencies, properties, etc in the parent pom and each child pom references it as its parent and therefore gets all the settings from there. These settings, properties, etc can be overridden in the child if need be.

The other use of the parent/child structure is that it can be used to build the entire set of projects, by setting up the parent pom with references to its children and then invoking Maven on the parent pom and each child gets built too.

Author

Commented:
any good code example illustrating this and reference link to read more about this? please advise
mccarlIT Business Systems Analyst / Software Developer
Top Expert 2015

Commented:

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial