zoukankan      html  css  js  c++  java
  • maven 内置变量对应目录

    [b]在创建Maven工程后,插件配置中通常会用到一些Maven变量,因此需要找个地方对这些变量进行统一定义,下面介绍如何定义自定义变量。[/b]

    在根节点project下增加properties节点,所有自定义变量均可以定义在此节点内,如下所示:


    <!-- 全局属性配置 -->
    <properties>
    <project.build.name>tools</project.build.name>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    [b]Maven内置变量说明:[/b]
    [list]
    [*]${basedir} 项目根目录
    [*]${project.build.directory} 构建目录,缺省为target
    [*]${project.build.outputDirectory} 构建过程输出目录,缺省为target/classes
    [*]${project.build.finalName} 产出物名称,缺省为${project.artifactId}-${project.version}
    [*]${project.packaging} 打包类型,缺省为jar
    [*]${project.xxx} 当前pom文件的任意节点的内容
    [/list]

     

    pom中对应元素的值。例如${project.artifactId}对应了<project><artifactId>元素的值,常用的POM属性包括:                                     

    ${project.build.sourceDirectory}:项目的主源码目录,默认为src/main/java/.                                                                                                         

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

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

     ${project.build.outputDirectory}:项目主代码编译输出目录,默认为target/classes/.                                                                                             

     ${project.build.testOutputDirectory}:项目测试代码编译输出目录,默认为target/testclasses/.                                                                              

     ${project.groupId}:项目的groupId.                                                                                                                                                                       

     ${project.artifactId}:项目的artifactId.                                                                                                                                                                    

     ${project.version}:项目的version,于${version}等价                                                                                                                                                

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

     

  • 相关阅读:
    maven打包时加入依赖包及加入本地依赖包
    is_file和file_exists效率比较
    window.open()详解及浏览器兼容性问题示例探讨
    Zend Studio汉化失败,如何给Zend Studio进行汉化
    HTML页面跳转的5种方法
    PHP中的符号 ->、=> 和 :: 分别表示什么意思?
    php中$this->是什么意思
    关于define('DISCUZ_ROOT', substr(dirname(__FILE__), 0, -7));的理解
    【精华】PHP网站验证码不显示的终结解决方案
    php提示undefined index的几种解决方法
  • 原文地址:https://www.cnblogs.com/Andrew520/p/10521546.html
Copyright © 2011-2022 走看看