Maven内嵌变量收集,以及解释
2013-03-19 14:17
176 查看
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
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
相关文章推荐
- 对“C++添加一个头文件和extern以及全局变量和局部变量问题”的解释
- 自定义maven变量以及maven内置常量
- maven环境变量配置以及失败的原因
- maven 安装jar 包到本地仓库,以及maven环境变量 配置
- maven添加远程仓库以及导出依赖的jar包以及常用操作收集
- JVM中各内存区域解释,以及变量的作用域解释
- Maven学习 --- 常见变量解释 && 问题解决
- Maven的学习资料收集--(九) 构建SSH项目以及专栏maven
- Maven的学习资料收集--(九) 构建SSH项目以及专栏maven
- 嵌入式 shell相关经典解释如变量以及赋值和特殊符号
- Maven学习笔记(一)——自定义maven变量以及maven内置常量
- 环境变量的解释和配置 以及命令行运行java程序
- Maven学习第一节---maven入门(maven下载和环境变量以及本地仓库配置)
- Maven学习笔记(一)——自定义maven变量以及maven内置常量
- Unity Shader:细分着色器(Tessellation Shader)在顶点与片段着色器中的写法以及各参数变量解释。
- 用类名做方法的返回值类型 在学习Java的初始阶段,很多同学使用基本数据类型定义变量和引用类型定义变量以及使用类名做方法的返回值类型常常不知所以。今天我以自己的解读方式和个人的理解作一个简单的解释,和
- JDK环境变量以及tomcat配置,maven配置
- maven下载部署以及环境变量配置
- Win7中maven 下载、安装以及环境变量配置
- 代码块的解释,构造代码块,静态代码块,静态常量和常量以及静态成员变量和对象成员变量的区别