zoukankan      html  css  js  c++  java
  • 学习Maven POM

    什么是POM

    POM stands for “Project Object Model”.It is an XML representation of a Maven project held in a file named pom.xml.

    Maven Coordinates

    groupId:artifactId:version是必须字段

    groupId:artifactId:packaging:classifier:version可选

    groupId:类似包名,例如:org.codehaus.mojo

    artifactId:项目名称

    packaging:打包方式,默认是jar。如果设置成war,就是用<packaging>war</packaging>

    version:项目版本号

    classifier:

    项目关系(POM Relationships)

    项目关系包括:依赖(传递依赖)、继承和组合

    Dependencies

    POM的基础是依赖表。

    Exclusions

    告诉maven,这个依赖不进行传递。也就是说这个是当前引用,不传递给上层项目。

    Inheritance

    The elements in the parent POM that are inherited by its children are:

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

    Aggregation (or Multi-Module)

    <modules>
        <module>my-project</module>
        <module>another-project</module>
      </modules>
    属性(Properties)
    访问方式:${X}
    使用5中方式来访问:
    1. 环境变量——env.X
    例如:${env.PATH}访问环境变量中的PATH
    2. project.x
    pom文件中相关的值。例如<project><version>1.0</version></project> is accessible via ${project.version}.
    3. settings.x
    settings.xml文件中相关的值。例如:<settings><offline>false</offline></settings> is accessible via ${settings.offline}.
    4. Java系统属性
    ${java.home}
    5. x
    POM中<properties />元素的值。例如<properties><someVar>value</someVar></properies>—>${someVar}
    二、构建设置
    build reporting
    参考:
    http://maven.apache.org/pom.html

    Configuring the Jetty Maven Plugin

  • 相关阅读:
    事件使用(转 )
    使用Dotfuscator 进行.Net代码混淆 代码加密的方法
    Git分布式版本控制系统学习笔记
    免费SVN服务器笔记
    如何设置mysql远程访问及防火墙设置
    c# GridControl怎么换行
    模拟Post登陆带验证码的网站
    c#控制打印机杂项
    ssh 自动登录
    mysql 使用记号
  • 原文地址:https://www.cnblogs.com/javawer/p/3988624.html
Copyright © 2011-2022 走看看