You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by hb...@apache.org on 2023/03/05 17:38:55 UTC
[maven-release] 01/01: [MRELEASE-431] add user documentation for version policies
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to branch MRELEASE-431_doc
in repository https://gitbox.apache.org/repos/asf/maven-release.git
commit 717bd0d9e7027e06a17cedbaa1ae7bec4730f8e8
Author: Hervé Boutemy <hb...@apache.org>
AuthorDate: Sun Mar 5 18:38:47 2023 +0100
[MRELEASE-431] add user documentation for version policies
---
.../shared/release/policy/version/VersionPolicy.java | 2 +-
.../shared/release/policies/DefaultVersionPolicy.java | 3 ++-
.../src/site/apt/examples/prepare-release.apt.vm | 19 +++++++++++++++++--
3 files changed, 20 insertions(+), 4 deletions(-)
diff --git a/maven-release-api/src/main/java/org/apache/maven/shared/release/policy/version/VersionPolicy.java b/maven-release-api/src/main/java/org/apache/maven/shared/release/policy/version/VersionPolicy.java
index e9fd5fce..40c812cc 100644
--- a/maven-release-api/src/main/java/org/apache/maven/shared/release/policy/version/VersionPolicy.java
+++ b/maven-release-api/src/main/java/org/apache/maven/shared/release/policy/version/VersionPolicy.java
@@ -23,7 +23,7 @@ import org.apache.maven.shared.release.policy.PolicyException;
import org.apache.maven.shared.release.versions.VersionParseException;
/**
- * API for next version calculations, used by maven-release-plugin to suggest release and next develoment versions.
+ * API for next version calculations, used by maven-release-plugin to suggest release and next development versions.
*
* @since 2.5.1 (MRELEASE-431)
*/
diff --git a/maven-release-manager/src/main/java/org/apache/maven/shared/release/policies/DefaultVersionPolicy.java b/maven-release-manager/src/main/java/org/apache/maven/shared/release/policies/DefaultVersionPolicy.java
index cf29d386..a3df92a0 100644
--- a/maven-release-manager/src/main/java/org/apache/maven/shared/release/policies/DefaultVersionPolicy.java
+++ b/maven-release-manager/src/main/java/org/apache/maven/shared/release/policies/DefaultVersionPolicy.java
@@ -29,7 +29,8 @@ import org.apache.maven.shared.release.versions.DefaultVersionInfo;
import org.apache.maven.shared.release.versions.VersionParseException;
/**
- * <p>DefaultVersionPolicy class.</p>
+ * Default version policy: proposed release version just removes {@code -SNAPSHOT},
+ * next development version adds a minor increment to release and adds {@code -SNAPSHOT}.
*
* @author Robert Scholte
*/
diff --git a/maven-release-plugin/src/site/apt/examples/prepare-release.apt.vm b/maven-release-plugin/src/site/apt/examples/prepare-release.apt.vm
index d7cf6a4a..f102e0c3 100644
--- a/maven-release-plugin/src/site/apt/examples/prepare-release.apt.vm
+++ b/maven-release-plugin/src/site/apt/examples/prepare-release.apt.vm
@@ -34,7 +34,7 @@ Prepare a Release
* Check that there are no SNAPSHOT dependencies
- * Change the version in the POMs from x-SNAPSHOT to a new version (you will be prompted for the versions to use)
+ * Change the version in the POMs from x-SNAPSHOT to a new release version (you will be prompted for the versions to use, with a default value proposed by version policy configured as <<<projectVersionPolicyId>>>)
* Transform the SCM information in the POM to include the final destination of the tag
@@ -44,7 +44,7 @@ Prepare a Release
* Tag the code in the SCM with a version name (this will be prompted for)
- * Bump the version in the POMs to a new value y-SNAPSHOT (these values will also be prompted for)
+ * Bump the version in the POMs to a new value y-SNAPSHOT (these values will also be prompted for, with a default value proposed by version policy configured as <<<projectVersionPolicyId>>>)
* Eventually run completion goal(s) against the project (since 2.2)
@@ -144,3 +144,18 @@ mvn release:prepare-with-pom
[]
The <<<project.>>> prefix is optional and may be omitted.
+
+* Overriding the release and next development versions proposed by default
+
+ By default, the proposed release version is the current version without <<<-SNAPSHOT>>>, and the proposed next development version is a minor increment
+ to the release with <<<-SNAPSHOT>>>.
+
+ The proposed values policy can be configured by {{{/prepare-mojo.html#projectVersionPolicyId}<<<projectVersionPolicyId>>> parameter}}.
+
+ Maven Release Plugin provides 2 alternate policies:
+
+ * <<<OddEvenVersionPolicy>>>: even version numbers for releases, and odd version numbers for development (see {{{../../maven-release-policies/maven-release-oddeven-policy/apidocs/org/apache/maven/shared/release/policy/oddeven/OddEvenVersionPolicy.html}javadoc}}),
+
+ * <<<SemVerVersionPolicy>>>: increase minor element when resolving the development version (see {{{../../maven-release-policies/maven-release-semver-policy/apidocs/org/apache/maven/shared/release/policy/semver/SemVerVersionPolicy.html}javadoc}}).
+
+ []