The version number in the POM file is not useless, but it certainly is under some pressure while many organizations transition to flavors of Continuous Delivery (as you funnel commits, branches, and then some anointed branches like develop
through levels of increasing scrutiny (CI, QA), you may not necessarily have release versions separate from SNAPSHOT
versions).
The best practice for releasing Maven projects is to use the Maven Release Plugin. It will prepare the release (e.g. 13.3.0
), tag the release (13.3.0
), and prepare for the next development iteration (e.g. 13.3.1-SNAPSHOT
). During the development iteration SNAPSHOT
versions (e.g. 13.3.1-SNAPSHOT
) are scattered around with no expectation of reproducibility. These versions may not even be VCS-committed, or they are be on branches that may still be squashed out of existence, later. The version in the POM file is thus useful because it always declares what version you're looking at (in your VCS). Using the Maven Release Plugin helps you to warrant that there's not two releases with the same version (e.g. 13.3.0
).
Also note that if you're distinguishing between build and consumer POMs, the latter is used to depend on an artifact, and the dependent project needs to express the version number to match that of the dependency's POM file.