>>>>> Steinar Bang <[email protected]>:
>>>>> Mirko Friedenhagen <[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...?
Digging into what I did back in 2021:
- I wanted to have a BOM defining lots of version numbers
- I wanted projects using my parent POM(s) to be able to use that BOM
in their dependencyManagement
- Using the BOM needed a version for the BOM
- The version would always be the same as for the parent POM
- But it is impossible to find the version for your top pom's parent in
a maven project
- I can't (or won't) put the BOM in <dependencyManagement> of the
parent pom project, because that would unintentionally "poison" any
BOM projects inheriting from the parent pom would like to create (all
of the parent BOM's dependencies would be made part of that BOM as
well and confusion would follow)
So what I did was to have a property bang-bom.version that "shadows" the
parent pom project version.
I did the shadowing by:
1. Defining the property in the paremt pom project's top pom
https://github.com/steinarb/bang-bompom/blob/20d12dd29b2d3758f1c237b3c29df98ecc9125f8/pom.xml#L33
2. Setting the property's value to the current pom project value when
doing a release
https://github.com/steinarb/bang-bompom/blob/20d12dd29b2d3758f1c237b3c29df98ecc9125f8/pom.xml#L82
And now that 2021 hack has come back to bite me...
Anyone with a better idea of how to get the BOM version to a child
project?
Thanks!
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]