From 2344307c041bd293c816e29811431b16b0738af7 Mon Sep 17 00:00:00 2001 From: Slawomir Jaranowski Date: Sun, 19 Nov 2023 18:42:57 +0100 Subject: [PATCH] Deprecate maven-version goal --- .../mojo/buildhelper/MavenVersionMojo.java | 4 ++ src/site/apt/index.apt | 2 - src/site/apt/usage.apt.vm | 42 ------------------- 3 files changed, 4 insertions(+), 44 deletions(-) diff --git a/src/main/java/org/codehaus/mojo/buildhelper/MavenVersionMojo.java b/src/main/java/org/codehaus/mojo/buildhelper/MavenVersionMojo.java index 2483e14d..66b9154c 100644 --- a/src/main/java/org/codehaus/mojo/buildhelper/MavenVersionMojo.java +++ b/src/main/java/org/codehaus/mojo/buildhelper/MavenVersionMojo.java @@ -35,7 +35,11 @@ * * @author pgier * @since 1.3 + * @deprecated Maven since version {@code 3.0.4} has such property build in: + * MNG-4112. + * So goal can be removed. */ +@Deprecated @Mojo(name = "maven-version", defaultPhase = LifecyclePhase.VALIDATE, threadSafe = true) public class MavenVersionMojo extends AbstractDefinePropertyMojo { diff --git a/src/site/apt/index.apt b/src/site/apt/index.apt index cccf23ed..f322694b 100644 --- a/src/site/apt/index.apt +++ b/src/site/apt/index.apt @@ -55,8 +55,6 @@ Build Helper Maven Plugin * {{{./attach-artifact-mojo.html}build-helper:attach-artifact}} Attach additional artifacts to be installed and deployed. - * {{{./maven-version-mojo.html}build-helper:maven-version}} Set a property containing the current version of maven. - * {{{./regex-property-mojo.html}build-helper:regex-property}} Sets a property by applying a regex replacement rule to a supplied value. * {{{./regex-properties-mojo.html}build-helper:regex-properties}} Sets a property by applying a regex replacement rule to a supplied value. diff --git a/src/site/apt/usage.apt.vm b/src/site/apt/usage.apt.vm index bbacd450..5b007ada 100644 --- a/src/site/apt/usage.apt.vm +++ b/src/site/apt/usage.apt.vm @@ -191,48 +191,6 @@ Usage ------------------- -* Set the current version of Maven in a property - - This can be used to keep track of what version of Maven was used to build a particular artifact. - For example, the following POM sets the property and then uses the property to save the Maven version - to the project JAR's manifest. - -------------------- - - ... - - - - org.codehaus.mojo - build-helper-maven-plugin - ${project.version} - - - maven-version - - maven-version - - - - - - org.apache.maven.plugins - maven-jar-plugin - 3.0.2 - - - - ${maven.version} - - - - - - - ... - -------------------- - * Access the parsed components of a project version The <<>> goal can be used to access the component parts of a version string. For example,