Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Deprecate maven-version goal #191

Merged
merged 1 commit into from
Nov 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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