zoukankan      html  css  js  c++  java
  • Maven内嵌变量收集,以及解释

    There are some implicit properties available in any Maven project, these implicit properties are:
    project.*
    Maven Project Object Model (POM). You can use the project.* prefix to reference values in a Maven
    POM.
    settings.*
    Maven Settings. You use the settings.* prefix to reference values from your Maven Settings in
    ~/.m2/settings.xml.
    env.*
    Environment variables like PATH and M2_HOME can be referenced using the env.* prefix.
    System Properties
    Any property which can be retrieved from the System.getProperty() method can be referenced as
    a Maven property.

    The following list shows some common property references from the Maven project.

    project.groupId and project.version
    Projects in a large, multi-module build often share the same groupId and version identifiers. When
    you are declaring interdependencies between two modules which share the same groupId and version,
    it is a good idea to use a property reference for both:

    <dependencies>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>sibling-project</artifactId>
            <version>${project.version}</version>
        </dependency>
    </dependencies>

    project.artifactId
    A project’s artifactId is often used as the name of a deliverable. For example, in a project with WAR
    packaging, you will want to generate a WAR file without the version identifiers. To do this, you would
    reference the project.artifactId in your POM file like this:
    <build>
        <finalName>${project.artifactId}</finalName>
    </build>

    project.name and project.description
    The name and project description can often be useful properties to reference from documentation. Instead of
    having to worry that all of your site documents maintain the same short descriptions, you can just reference
    these properties.

    project.build.*
    If you are ever trying to reference output directories in Maven, you should never use a literal value like
    target/classes. Instead you should use property references to refer to these directories.
        • project.build.sourceDirectory
        • project.build.scriptSourceDirectory
        • project.build.testSourceDirectory
        • project.build.outputDirectory
        • project.build.testOutputDirectory
        • project.build.directory

    project.baseUri
    If you need a valid URI for your project’s base directory, you can use the ${project.baseUri}
    property. If your project is stored in the directory /tmp/simple, ${project.baseUri} will resolve
    to file:/private/tmp/simple/.
    Maven: The Complete Reference

    Other Project Property references
    There are hundreds of properties to reference in a POM. A complete reference for the POM structure is
    available at http://maven.apache.org/ref/3.0.3/maven-model/maven.html

  • 相关阅读:
    Python学习笔记--列表
    jmeter适用python来处理接口加密
    pytest-fixture参数化params(重要)
    Python38+Robot Framework 安装ExcelLibrary一直报错,提示“dist.py:267: userwarning: unknown distribution option: ‘inst’”
    robotframework之RIED运行测试用例报错Suite ‘XXX‘ contains no tests matching name ‘XXX‘ in sin suite
    在win10上安装python3.8 + Robotframework +RIDE报错
    Pytest自动化测试 断言失败后续代码继续执行
    学习pytest+allureUI自动化记录(示例代码)
    接口测试 Pytest断言处理_assert和异常断言
    selenium有界面下正常,无界面下报错:Message: element not interactable (Session info: headless chrome)
  • 原文地址:https://www.cnblogs.com/zhangqingsh/p/2969116.html
Copyright © 2011-2022 走看看