内容来自:http://docs.codehaus.org/display/MAVENUSER/MavenPropertiesGuide
MavenPropertiesGuide
Intro
Because I couldn't find a clear overview of which properties are availabe in maven2 I started this page. It is a collection of things found in the offcial maven documentation and postings to the maven user mailing list.
Note: In Maven 3.0, all pom.*
properties are deprecated. Use project.*
instead!
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.
outputD
irectory
}
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>
Java system properties
All Java System Properties defined by the JVM.
Custom properties in the POM
User defined properties in the pom.xml.
<project> ... <properties>
<my.filter.value>hello</my.filter.value>
</properties>
... </project> |
-
${my.filter.value
} will result inhello
if you inserted the above XML fragment in your pom.xml
Parent Project variables
How can parent project variables be accessed?
You can use the prefix: ${project.parent
}.
A good way to determine possible variables is to have a look directly at the API. I'm currently using Maven 2.2.1, and to access the Parent you can use ${project.parent
}. This will return an org.apache.maven.project.MavenProject instance.
To access the parent version: ${parent.version
}.
Reflection Properties
The pattern ${someX.someY.someZ
} can simply sometimes mean getSomeX().getSomeY().getSomeZ()
. Thus, properties such as ${project.build.directory
} is translated to getProject().getBuild().getDirectory()
.
相关推荐
1、添加了阿里云maven和spring、google、spring-plugin、apache等的国内源 2、有关配置使用Jetbrain IDEA内置Maven的环境变量的教程。
maven window下安装包 易学笔记-maven教程目录 第1章:Maven概述/1.1 Maven的概念 第1章:Maven概述/1.2 Maven的功能 第1章:Maven概述/1.3 与其它构建相比/1.3.1 Make 第1章:Maven概述/1.3 与其它构建相比/1.3.2...
maven安装包,稳定版本,自动配置环境变量,内置使用介绍及setting文件,方便团队开发打包及代码合并
内置变量: target_os 、 target_arch 、 target_config 目标的内置函数: shared_library 、 static_library 、 executable (包括苹果应用程序包、游戏机目标) android_apk maven 包下载器 AndroidManifest 合并 ...
该库具有名为desert-base.properties的内置属性文件。 任何属性都可以被用户定义的属性文件desert.properties 。 属性文件必须在项目的标准资源路径中可用。 属性搜索顺序: desert.properties -> desert-base.p
我们正在使用具有内置Maven集成的Intellij IDEA社区版。 下载并安装Apache Maven。 建议使用Maven3.2.x。 设置M2_HOME环境变量。 运行mvn -version以验证您的设置。 我们正在使用Maven 3.2.5。 在我们的设置中
Java 提供两种不同的类型:引用类型和原始类型(或内置类型)。Int是java的原始数据类型,Integer是java为int提供的封装类。Java为每个原始类型提供了封装类。 原始类型封装类booleanBoolean charCharacter byteByte...
包含多个内置验证 从注释生成帮助 支持默认值 在默认值上使用变量替换 支持列表和var-ags 支持任何Java类型,通常开箱即用 只需注释任何Java方法的参数,即可通过几乎零附加工作从命令行界面调用它。 命令注册,...
实际上,要实现它,您需要使用'scss'使用它的内置Sass变量,但是Java默认情况下不支持'.scss'文件,我们需要在幕后使用node.js来满足这些要求。 除此之外,我们还在该项目中配置并使用了spring-security,以演示...
3.1.1 内置选项 3.1.2 日志 3.2 环境 3.3 数据源 3.3.1 数据源和环境 3.3.2 JNDI数据源 3.3.3 自动数据库移植 3.4 外部配置 3.5 定义版本 4. 命令行 4.1 创建Gant脚本 4.2 可复用的Grails脚本 4.3 脚本中的事件 4.4 ...
直观、方便、容易使用支持复杂实体类和变量的反序列化等对泛型的良好支持不断更新的内置注解,方便处理数据可自定义注解,拓展Lson功能下载Gradleimplementation 'cn.luern0313.lson:Lson:0.90'Maven<dependency> ...
Maven <groupId>org.mariuszgromada.math <artifactId>MathParser.org-mXparser <version>4.4.2 标量科学计算器,图表和脚本-我的新项目 标量在行动 标量-免费版本 Scalar Pro-全付费版本 MathParser.org-mXparser ...
不需要其他依赖项(请看内置部分)。· 目录 关于该项目 Banzai是一种轻量级,可扩展的Web服务器,非常轻巧(在本地而不是Docker上工作时)。服务器能够理解并响应HTTP / 1.1(不是HTTP / 2.0)。 建于 Java 入门 ...
26.2.2 Web安全表达式中的路径变量 204 26.3方法安全表达式 204 26.3.1 @Pre和@Post注释 205 访问控制使用@PreAuthorize和@PostAuthorize 205 使用@PreFilter和@PostFilter进行过滤 207 26.3.2内置表达式 207 ...
{1.5}基本类型变量的初始值}{26}{section.1.5} {1.6}数据类型转换}{26}{section.1.6} {1.7}方法}{26}{section.1.7} {1.8}运算符}{27}{section.1.8} {1.8.1}自增运算}{28}{subsection.1.8.1} {1.8.1.1}...