I am trying to parse my pom.xml in a jenkins pipeline plugin. I intend to change it and save it back.
My problem is that it gives me the "unclassified field java.lang.String version"
My code is as follows:
@NonCPS groovy.util.Node getPom(path) { new XmlParser().parseText(readFile(path)).version } node { groovy.util.Node pomNode = getPom("pom.xml") println pomNode }
A similar issue was discussed here: Parsing an XML file as part of a Jenkins project
source share