Skip to content

Commit 2237441

Browse files
Deprecate maven-version goal
1 parent ef477d8 commit 2237441

File tree

3 files changed

+4
-44
lines changed

3 files changed

+4
-44
lines changed

src/main/java/org/codehaus/mojo/buildhelper/MavenVersionMojo.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,11 @@
3535
*
3636
* @author pgier
3737
* @since 1.3
38+
* @deprecated Maven since version {@code 3.0.4} has such property build in:
39+
* <a href="https://issues.apache.org/jira/browse/MNG-4112">MNG-4112</a>.
40+
* So goal can be removed.
3841
*/
42+
@Deprecated
3943
@Mojo(name = "maven-version", defaultPhase = LifecyclePhase.VALIDATE, threadSafe = true)
4044
public class MavenVersionMojo extends AbstractDefinePropertyMojo {
4145

src/site/apt/index.apt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,6 @@ Build Helper Maven Plugin
5555

5656
* {{{./attach-artifact-mojo.html}build-helper:attach-artifact}} Attach additional artifacts to be installed and deployed.
5757

58-
* {{{./maven-version-mojo.html}build-helper:maven-version}} Set a property containing the current version of maven.
59-
6058
* {{{./regex-property-mojo.html}build-helper:regex-property}} Sets a property by applying a regex replacement rule to a supplied value.
6159

6260
* {{{./regex-properties-mojo.html}build-helper:regex-properties}} Sets a property by applying a regex replacement rule to a supplied value.

src/site/apt/usage.apt.vm

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -191,48 +191,6 @@ Usage
191191
</project>
192192
-------------------
193193

194-
* Set the current version of Maven in a property
195-
196-
This can be used to keep track of what version of Maven was used to build a particular artifact.
197-
For example, the following POM sets the property and then uses the property to save the Maven version
198-
to the project JAR's manifest.
199-
200-
-------------------
201-
<project>
202-
...
203-
<build>
204-
<plugins>
205-
<plugin>
206-
<groupId>org.codehaus.mojo</groupId>
207-
<artifactId>build-helper-maven-plugin</artifactId>
208-
<version>${project.version}</version>
209-
<executions>
210-
<execution>
211-
<id>maven-version</id>
212-
<goals>
213-
<goal>maven-version</goal>
214-
</goals>
215-
</execution>
216-
</executions>
217-
</plugin>
218-
<plugin>
219-
<groupId>org.apache.maven.plugins</groupId>
220-
<artifactId>maven-jar-plugin</artifactId>
221-
<version>3.0.2</version>
222-
<configuration>
223-
<archive>
224-
<manifestEntries>
225-
<Maven-Version>${maven.version}</Maven-Version>
226-
</manifestEntries>
227-
</archive>
228-
</configuration>
229-
</plugin>
230-
</plugins>
231-
</build>
232-
...
233-
</project>
234-
-------------------
235-
236194
* Access the parsed components of a project version
237195

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

0 commit comments

Comments
 (0)