4

Can any one explain how to create Parent POM, specific to organization .

Here I am not looking for multimodule project.

The POM what I am going to create will be used by all the projects and each project will have their own parent pom which extends the organization specific POM.

Please provide some steps how to create in Eclipse.

Michael Benjamin
  • 346,931
  • 104
  • 581
  • 701
Madhu
  • 552
  • 2
  • 10
  • 23
  • Most important is to define all plugins with their appropriate version Example: https://github.com/khmarbaise/smpp/blob/master/pom.xml – khmarbaise Aug 18 '16 at 05:35

1 Answers1

7

Parent POM is called a BOM in Maven, you can put it anywhere so long as you define modules inside it, which will have their own poms. Example

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>myorg</groupId>
    <artifactId>Myorg BOM</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>pom</packaging>
    <name>Myorg BOM</name>

    <modules>
        <module>location/of/module1</module>
        <module>location/of/module2</module>
        <module>location/of/module3</module>
    </modules>
...

Then you just create a POM for each individual component in the path provided in module. You can create this inside an eclipse project.

niken
  • 2,499
  • 3
  • 33
  • 56
  • Hi Nik thanks for comments ,what ever you created is specific to project.But i am looking for POm for entire organization. i.e Parent pom with out modules and that will be used by project specific pom where i will defined modules – Madhu Aug 17 '16 at 23:37
  • You can define a pom and include it as a dependency in other poms... See this answer for more info: http://stackoverflow.com/questions/11778276/difference-between-scope-import-and-pom-type-dependency – niken Aug 18 '16 at 13:41