Parsing an XML file within a Jenkins pipeline
问题 I have an XML file which I'd like to use as input for a pipeline script. Problem is the XMLParser isn't serializable so I put it in a NonCPS function, but I lost the Node object because of that. This is the pipeline script: def buildPlanPath = 'C:\\buildPlan_test.xml' @NonCPS groovy.util.Node getBuildPlan(path) { new XmlParser().parseText(readFile(path)) } node { //def buildPlan = new XmlParser().parseText(readFile(buildPlanPath)) groovy.util.Node buildPlan = getBuildPlan(buildPlanPath)