Maven - Version


Version in Maven can refere to:



To get the Maven Version, just execute this option

mvn --version
Apache Maven 3.1.1 (0728685237757ffbf44136acec0402957f723d9a; 2013-09-17 17:22:22+0200)
Maven home: C:\apache-maven-3.1.1\bin\..
Java version: 1.6.0_32, vendor: Sun Microsystems Inc.
Java home: C:\Progra~1\Java\jdk1.6.0_32\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"


Version is one component of the artifact defined in the pom and follows the semantic versioning scheme.


If version finishes with -SNAPSHOT, the release and deployment process follows the snapshot release process.

How to pass the pom version to the code

To replace the artifact version in a class during the build process, you can use the below plugin:

		<token>@[email protected]</token>


public class Version {
	private Version() {
		// don't instantiate

	public static String id() {
		return "@[email protected]";
	public static void main(String[] args) {

Documentation / Reference

Powered by ComboStrap