Skip to content

Commit

Permalink
Deprecate maven-version goal
Browse files Browse the repository at this point in the history
  • Loading branch information
slawekjaranowski committed Nov 19, 2023
1 parent ef477d8 commit 2344307
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 44 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@
*
* @author pgier
* @since 1.3
* @deprecated Maven since version {@code 3.0.4} has such property build in:
* <a href="https://issues.apache.org/jira/browse/MNG-4112">MNG-4112</a>.
* So goal can be removed.
*/
@Deprecated
@Mojo(name = "maven-version", defaultPhase = LifecyclePhase.VALIDATE, threadSafe = true)
public class MavenVersionMojo extends AbstractDefinePropertyMojo {

Expand Down
2 changes: 0 additions & 2 deletions src/site/apt/index.apt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
42 changes: 0 additions & 42 deletions src/site/apt/usage.apt.vm
Original file line number Diff line number Diff line change
Expand Up @@ -191,48 +191,6 @@ Usage
</project>
-------------------

* 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.

-------------------
<project>
...
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>${project.version}</version>
<executions>
<execution>
<id>maven-version</id>
<goals>
<goal>maven-version</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.0.2</version>
<configuration>
<archive>
<manifestEntries>
<Maven-Version>${maven.version}</Maven-Version>
</manifestEntries>
</archive>
</configuration>
</plugin>
</plugins>
</build>
...
</project>
-------------------

* Access the parsed components of a project version

The <<<parse-version>>> goal can be used to access the component parts of a version string. For example,
Expand Down

0 comments on commit 2344307

Please sign in to comment.