Maven Properties

You can use Maven properties in a pom.xml file or in any resource that is being processed by the Maven Resource plugin’s filtering features.
A property is always surrounded by ${ and }. For example, to reference the ${project.version} property

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 ${project.*} actually resolved to a MavenProject object. From there, you can just use bean properties to get the value you need
${project.version} 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.*
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.

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/.

Built-in properties

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

Pom/Project properties

${} 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

<project xmlns="" xmlns:xsi=""

Local user settings

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

Environment variables

${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

It’s not a good idea to use properties for artifact IDs. The ${} property cannot be resolved when using it as part of artifactId, however some properties do work (project.groupId for the artifactId seems to work).
However, this is not recommended. In fact, if you use any property for the artifact ID instead of a constant, you’ll get a warning when you build your project:



books sonatype mvnref-book

Maven Properties