Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Parent pom

 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In Maven multi module projects why parent pom should be packaged in pom
 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Because a parent POM should be nothing but a POM. By the way, I think you are confusing two different hierarchy mechanisms.

One is the module/submodule hierarchy. This is where there is a master POM which invokes submodule POMs to build the individual artifacts of a larger project. The master POM can be a POM package, or any other type of package. For example, it could be an ear, or even a jar (you could use the assembly plugin to create a runnable jar). Though usually it is best to have the master POM be a POM package, and have the last submodule be the "packager".

The other hierarchy is the parent/child hierarchy. In this case the parent POM is always packaged as POM. Also, the parent contains declarations common to all of its children. For example, I have a parent POM for building JArs that has all of my common settings for all JAR files. Then each time I need a new project that defines a JAR, I reference the parent POM and get all of that configuration information automatically.

There is no rule that says that a master POM must be a parent POM for the submodules. And I recommend against doing that. I have been telling my co-workers this for years and each time they don't listen to me, and make the master POM also a parent POM, they run into problems.
 
It is no measure of health to be well adjusted to a profoundly sick society. -Krishnamurti Tiny ad:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
    Bookmark Topic Watch Topic
  • New Topic