maven 内置pom属性

内置属性:如 ${basedir} 表示项目根目录 即包含了pom.xml文件的目录 ${version} 表示项目版本

pom属性

  ${project.build.sourcedirectory} : 项目构建输出目录,默认为src/main/java

  ${project.build.testSourceDirectory} : 项目的测试源码目录,默认为src/test/java/

  ${project.build.directory} :项目构建输出目录,默认为target/

  ${project.outputDirectory} :项目测试代码编写输出目录。默认为target/test-calsses

  ${project.groupId} : 项目的groupId

  ${project.artifactId}

  ${project.version}

  ${project.build.finalName} :  项目打包输出文件的名称, 默认为 ${project.artifactId} - ${project.version}

setting属性

 用户使用以setting开头的属性引用setting.xml文件中属性的值

 如:${setting.localRepository} 指向用户本地仓库的地址

java系统属性   可使用 mvn help:system 查看所有java系统属性

  举例 : ${user.home} 指向用户目录,

环境变量属性:可使用 mvn help:system 查看所有java系统属性

  举例:${env.JAVA_HOME} 指代了JAVA_HOME环境变量的值

如果不记得这些也没关系,直接打开当前项目pom.xml,使用Effective Pom 模式观看即可。如下图代码显示

<sourceDirectory>E:workspaceeclipse-mavenaccountsrcmainjava</sourceDirectory>
    <scriptSourceDirectory>E:workspaceeclipse-mavenaccountsrcmainscripts</scriptSourceDirectory>
    <testSourceDirectory>E:workspaceeclipse-mavenaccountsrc	estjava</testSourceDirectory>
    <outputDirectory>E:workspaceeclipse-mavenaccount	argetclasses</outputDirectory>
    <testOutputDirectory>E:workspaceeclipse-mavenaccount	arget	est-classes</testOutputDirectory>
    <resources>
      <resource>
        <directory>E:workspaceeclipse-mavenaccountsrcmain
esources</directory>
      </resource>
    </resources>
    <testResources>
      <testResource>
        <directory>E:workspaceeclipse-mavenaccountsrc	est
esources</directory>
      </testResource>
    </testResources>
    <directory>E:workspaceeclipse-mavenaccount	arget</directory>
    <finalName>account-parent-0.0.1-SNAPSHOT</finalName>

  

原文地址:https://www.cnblogs.com/yunian139/p/10666190.html