J Fabian Meier
J Fabian Meier

Reputation: 35805

Add suffix in maven release plugin

I would like to add a TEST suffix when building with the Maven release plugin. The idea that if the user which builds the artifact ticks a checkbox, then a TEST version is build.

So the POM contains a version like 1.2.3-SNAPSHOT and I would like to build 1.2.3-TEST. The Maven release plugin allows you to set the target version, but I do not know how I should reference the original version (or parts thereof) for the new version, like

${oldVersionWithoutSnapshot}-TEST$.

Any ideas how to implement this?

Upvotes: 1

Views: 1522

Answers (1)

user944849
user944849

Reputation: 14951

I would try the Build Helper Maven Plugin.

The parse-version goal parses the version to get the component parts, and regex-property does replacements.

I've also used the GMaven plugin before to set properties, but not for as specific a use case as yours. This answer gives the idea.

Upvotes: 2

Related Questions