How to create Maven Parent POM speciific to organization?

久未见 提交于 2021-02-07 19:40:20

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/39002511/how-to-create-maven-parent-pom-speciific-to-organization

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!