1

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?

J Fabian Meier
  • 33,516
  • 10
  • 64
  • 142

1 Answers1

1

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.

user944849
  • 14,524
  • 2
  • 61
  • 83