Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create Maven Parent POM speciific to organization?

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.

like image 250
Madhu Avatar asked Mar 11 '23 09:03

Madhu


1 Answers

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.

like image 161
niken Avatar answered Mar 20 '23 15:03

niken