Maven properties

Posted on by Kim

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)
  • ${} results in the path to your "target" directory, this is the same as ${}
  • ${} results in the path to your "target/classes" directory
  • ${}refers to the name of the project (deprecated: ${} ).
  • ${project.version} refers to the version of the project (deprecated: or ${pom.version}).
  • ${} 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:

Java system properties

All Java System Properties defined by the JVM.


Maven properties

0 Responses to "Maven properties":