Maven Default Properties

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} or ${pom.version

Pom/Project properties

All elements in the pom.xml, can be referenced with the project. prefix or using pom. as prefix. This list is just an example of some commonly used elements.

${} results in the path to your "target" dir, this is the same as ${} 
${} results in the path to your "target/classes" dir 
${} or ${} refers to the name of the project. 
${project.version} or ${pom.version} refers to the version of the project. 
${} refers to the final name of the file created when the built project is packaged 
${project.artifactId} refers to the artifact id

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. 
${maven.repo.local} also works for backward compatibility with maven1 ?? 

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:


Java system properties

All Java System Properties defined by the JVM.

Custom properties in the POM

User defined properties in the pom.xml. 


${my.filter.value} will result in hello 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${} is translated to getProject().getBuild().getDirectory()



'03.Build Process' 카테고리의 다른 글

Maven Default Properties  (0) 2012.06.29
Hudson Remote Run API  (0) 2012.05.17
Maven Dependency Version Range  (0) 2012.05.11
Hudosn을 통한 Maven depoly => Nexus  (0) 2012.02.17
package emma:emma 의 goal 은 Test를 2번한다?  (0) 2012.01.02
Jenkins plugin Install (Emma, N'SIQ)  (0) 2011.12.26
Posted by Stewie

티스토리 툴바