我正在尝试在 jenkins 管道插件中解析我的 pom.xml。我打算修改它并保存回来。
我的问题是它给了我“未分类字段 java.lang.String 版本”
我的代码如下:
@NonCPS
groovy.util.Node getPom(path) {
new XmlParser().parseText(readFile(path)).version
}
node {
groovy.util.Node pomNode = getPom("pom.xml")
println pomNode
}
这里已经讨论过类似的问题:Parsing an XML file within a Jenkins pipeline
最佳答案
关于maven - 在 Jenkins 管道中解析 pom.xml 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38531298/