Versioning Policies
When performing a release, the Maven Release Plugin needs to determine the next release and development version.
By default, it simply removes -SNAPSHOT for release version and increments the last digit of the version number for next development.
However, you can customize this behavior by using different version policies,
by settings the projectVersionPolicyId parameter to the desired version policy.
Maven Release Plugin comes with built-in version policies:
default- increments the last digit of the version number for next developmentOddEvenVersionPolicy- proposes even version numbers only for releases and odd numbers for developmentSemVerMajorDevelopment- increases major element for next development versionSemVerMinorDevelopment- increases minor element for next development versionSemVerPatchDevelopment- increases patch element for next development version, similar to default policySemVerMajorRelease- increases major element for release versionSemVerMinorRelease- increases minor element for release version
The SemVer* policies enforce Semantic Versioning rules.
Examples of version policies:
| projectVersionPolicyId | project version | next release version | next development version |
|---|---|---|---|
| default | 1.2.3-SNAPSHOT | 1.2.3 | 1.2.4-SNAPSHOT |
| OddEvenVersionPolicy | 1.0.1-SNAPSHOT | 1.0.2 | 1.0.3-SNAPSHOT |
| SemVerMajorDevelopment | 1.2.3-SNAPSHOT | 1.2.3 | 2.0.0-SNAPSHOT |
| SemVerMinorDevelopment | 1.2.3-SNAPSHOT | 1.2.3 | 1.3.0-SNAPSHOT |
| SemVerPatchDevelopment | 1.2.3-SNAPSHOT | 1.2.3 | 1.2.4-SNAPSHOT |
| SemVerMajorRelease | 1.2.3-SNAPSHOT | 2.0.0 | 2.0.1-SNAPSHOT |
| SemVerMinorRelease | 1.2.3-SNAPSHOT | 1.3.0 | 1.3.1-SNAPSHOT |



