`
AILIKES
  • 浏览: 178975 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

Maven常用内置变量

阅读更多

Built-in properties

  • ${basedir} represents the directory containing pom.xml
  • ${version} equivalent to ${project.version(deprecated: ${pom.version})

Pom/Project properties

All elements in the pom.xml, can be referenced with the project. prefix. This list is just an example of some commonly used elements. (deprecated: {pom.} prefix)

  • ${project.build.directory} results in the path to your "target" directory, this is the same as ${pom.project.build.directory}
  • ${project.build.outputDirectory} results in the path to your "target/classes" directory
  • ${project.name}refers to the name of the project (deprecated: ${pom.name} ).
  • ${project.version} refers to the version of the project (deprecated: or ${pom.version}).
  • ${project.build.finalName} refers to the final name of the file created when the built project is packaged

Local user settings

Similarly, values in the user's settings.xml can be referenced using property names with settings. prefix.

  • ${settings.localRepository} refers to the path of the user's local repository

Environment variables

Environment variables can be referenced using the env prefix

  • ${env.M2_HOME} returns the Maven2 installation path.
  • ${java.home} specifies the path to the current JRE_HOME environment use with relative paths to get for example:
    <jvm>${java.home}../bin/java.exe</jvm>
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics