zoukankan      html  css  js  c++  java
  • Maven的pom.xml文件结构之基本配置parent和继承结构

    1.Maven项目的继承

    Maven项目之间不仅存在多模块的聚合关系,而且Maven项目之间还可以存在相互继承的关系。

    Maven项目之间的继承关系通过<parent>表示,在子Maven项目的POM中配置示例如下:

    1. <parent>
    2. <groupId>com.mycompany.jcat</groupId>
    3. <artifactId>jcat-bundle</artifactId>
    4. <version>2.0</version>
    5. <relativePath>../jcat-bundle</relativePath>
    6. </parent>
    说明:给出被继承的父项目的具体信息。

    其中的relativePath给出父项目相对于子项目的路径,这样在构件子项目时首先从该相对路径查找父项目,如果没有才会从本地库或进而远程库中查找父项目。


    2.在子项目中,能够继承父项目的如下配置:

    • dependencies
    • developers
    • contributors
    • plugin lists
    • reports lists
    • plugin executions with matching ids
    • plugin configuration

    3.Maven的Super POM

    类似于Java中的java.lang.Object类,所有Java类都继承自该类。在Maven中也存在一个特殊的POM,被称为Super POM。任何Maven项目的POM都继承自Super POM。

    在Super POM中,设置如下:

    • Maven的central库
    • Maven的central插件库
    • build的基本参数和4个插件(maven-antrun-plugin、maven-assembly-plugin、maven-dependency-plugin和maven-release-plugin
    • reporting的基本目录
    • 一个profile(id=release-profile)

    本文链接:https://blog.csdn.net/taiyangdao/article/details/52357300
  • 相关阅读:
    [AGC019F] Yes or No
    [CF1063F]String Journey
    [Gym100490A] Approximation
    [ARC058C]Iroha and Haiku
    [互测题目]大括号树
    [UVA10859]放置街灯 Placing Lampposts
    PAT甲级1141PAT Ranking of Institutions
    PAT甲级1153Decode Registration Card of PAT
    使用Python语言通过PyQt5和socket实现UDP服务器
    数据结构-哈希
  • 原文地址:https://www.cnblogs.com/jpfss/p/11477336.html
Copyright © 2011-2022 走看看