mvn versions:set -DnewVersion=1.0.0
There is one nuance though. In some cases, project version is inherited from parent, and project's POM uses parent POM, like this:
<parent> <groupId>com.company</groupId> <artifactId>company-parent</artifactId> <version>1.0</version> <relativePath>../company-parent/pom.xml</relativePath> </parent>
In this case for a local maven build, version does not have to be defined in POM as it will be 2.0, the version number of parent. However, the mvn versions:set command will result in error with the following message:
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Project version is inherited from parent.
Thus, some version has to be added to the project. If project still has to have parent version for some reason, then just copy version from inside parent tag. Otherwise, just go with any valid version number.