Maven进阶笔记

2021-04-27  本文已影响0人  黄大海

适用人群

生命周期、阶段、插件、目标

不同打包类型绑定的阶段、插件和目标

POM(Project Object Model)

value evaluation result common examples
project.* POM content(参考 Super POM) {project.version}<br>{project.build.finalName}
{project.artifactId} <br>{project.build.directory}
project.basedir the directory containing the pom.xml file ${project.basedir}
project.baseUri the directory containing the pom.xml file as URI ${project.baseUri}
build.timestamp
maven.build.timestamp
the UTC timestamp of build start, in yyyy-MM-dd'T'HH:mm:ss'Z' default format, which can be overridden with maven.build.timestamp.format POM property ${maven.build.timestamp}
* user properties, set from CLI with -Dproperty=value ${skipTests}
* model properties, such as project properties set in the pom ${any.key}
maven.home The path to the current Maven home. ${maven.home}
maven.version The version number of the current Maven execution (since 3.0.4). For example, "3.0.5". ${maven.version}
maven.build.version The full build version of the current Maven execution (since 3.0.4). For example, "Apache Maven 3.2.2 (r01de14724cdef164cd33c7c8c2fe155faf9602da; 2013-02-19T14:51:28+01:00)". ${maven.build.version}
maven.repo.local The repository on the local machine Maven shall use to store installed and downloaded artifacts (POMs, JARs, etc). ${user.home}/.m2/repository
* Java system properties(see JDK reference) {user.home} <br>{java.home}
env.*
*
environment variables ${env.PATH}
settings.* Local user settings (see settings reference) ${settings.localRepository}

依赖管理

仓库配置

  <mirrors>
    <mirror>
      <id>other-mirror</id>
      <name>Other Mirror Repository</name>
      <url>https://other-mirror.repo.other-company.com/maven2</url>
      <mirrorOf>central</mirrorOf>
    </mirror>
  </mirrors>
上一篇 下一篇

猜你喜欢

热点阅读