I\'m using a versioning system that is represented by a.b.build where a is the overall version (will be 0 for prototype, alpha and beta versions, 1 for major release), b is
Nowadays I would recommend avoiding the Maven Release plugin, as well as the various handcrafted hacks mentioned in other answers.
Anything that results in file changes on a source code level is something that creates new commits and therefore needlessly pollutes your version history.
The only thing that should be responsible for managing version numbers for source code is your version control management system. Git, in other words.
The good news is that there are a few very good options available, tools which will put your git tags in control of the version numbering instead of the other way around.
The one I would recommend in your case is JGitver, which supports both Maven and Gradle setups in the form of plugins and is very very configurable.
All you need to do is add some files to the root of your project, configure it to taste, and set your version number in pom.xml to 0. Done. See enter link description here, here.