0

I would like to update a property in a given pom to the major+minor version of the new version when I perform a release.

To do this, I need to set goals to run during the release. I can calculate the property ahead of time, but the versions:set-property I've seen elsewhere appears to be gone (according to http://www.mojohaus.org/versions-maven-plugin/ and CLI use), and other goals for this plugin don't seem to be able to handle not using the exact version.

Is there any reasonably simple way to do this, or do I have to shell out to the exec or antrun plugins to do it? Regardless, it seems that there's nothing but text replacing that will fix it. The replacer plugin seems to work, but that requires grabbing the previous version, and would take work to not break other references.

Jason Carr
  • 194
  • 11
  • Can you give a example pom with the results you would like to have? – khmarbaise Jun 27 '18 at 20:37
  • Here's an example pom https://pastebin.com/raw/myXQTLik This is located in the same location as the other portion, though it is not part of the module and runs on its own. When the version releases to 2.5.0, I'd like the minor.version property to change to 2.5 The dependency part isn't critical, it's mostly there to show the version. – Jason Carr Jun 27 '18 at 21:06

1 Answers1

1

The Maven build helper plugin can set properties using regex. Maybe this is what you need.

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