Re: version:set-property doesn't seem to pick up -Dproperty and -DnewVersion user properties

Steinar Bang <[email protected]>
Newsgroups gmane.comp.jakarta.turbine.maven.user
Organization Probably a good idea
Message-ID <[email protected]>
>>>>> Steinar Bang <[email protected]>:

>> https://github.com/steinarb/bang-bompom/blob/20d12dd29b2d3758f1c237b3c29df98ecc9125f8/pom.xml#L96
>> When you set a configuration parameter via XML, you may not override it anymore with the property in my experience. 

> Thanks! According to the git history, this seems to be a trick I did
> back in 2021 to set an inherited property to the value of the parent
> pom's version...?

> Why did I do it in this manner I wonder? There has to be a simpler way...?

I found this stackoverflow answer: https://stackoverflow.com/a/66453563

I did the same thing in my project (moved the versions-maven-plugin
config into a profile activated by "mvn release:prepare" of the bompom
project and deleted the rest of the versions-maven-plugin):
 https://github.com/steinarb/bang-bompom/commit/a1d83c4388e3c5eb8e67df3adb12e4540b29e61f

The resulting config
 1. swizzles the bang-bom.version property to match the current pom
    version when doing "mvn release:prepare"
 2. allows setting properties with "mvn versions:set-property" from my
    script

One remaining worry is if any of the versions-maven-plugin config will
creep into projects using one of my parent poms when doing releases...?
I think not because the profile name is pretty specific and the config
of maven-release-plugin is not inherited by other projects.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.