IntelliJ provides Extract Property
refactoring which can be used to extract maven artifact versions to properties in pom.xml
.
Extract Property refactoring creates a new property definition in the specified pom.xml file, finds all the occurrences of the selected string in the hierarchy of pom.xml files, and replaces them with the above property in the format: ${}
https://www.jetbrains.com/help/idea/2016.2/extract-property.html
Does eclipse have something similar?
It seems that Eclipse didn't have such feature.
So I extracted the version by myself with a Java Helper class:
https://github.com/brabenetz/secured-properties/blob/master/src/test/java/net/brabenetz/lib/securedproperties/tools/ExtractPomVersions.java
Feel free to copy, past and modify the code.
Background:
I personally do not like the versions as property, because for defining the right versions there are dependency-management and plugin-management sections in Maven.
But it seems that the version-maven-plugin only works at best if it can update versions in properties:
http://www.mojohaus.org/versions-maven-plugin/update-properties-mojo.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With