How to extract version of a transitive dependency into a property?
Let's assume the following dependency hierarchy:
groupA:artifactA:1.0.0
+- groupB:artifactB:2.0.0
+- groupC:artifactC:3.4.9-RC1
Now in pom.xml of artifactA, I want to extract the resolved version of groupC:artifactC
and assign it to a property versionC=3.4.9-RC1
. This versionC I would like to use in the resource filtering phase in order to replace its placeholder in static files (placeholders in an XML structure, that is transformed at runtime by some framework into a modal dialog. XML e.g. <component>ArtifactC</component><version>${versionC}</version>
). It's clear that I don't want to define this versionC property myself, but let maven do the work for me.
I was searching the standard maven plugins, but could not identify a matching functionality. Maybe a combination of plugins?