我有一个Jenkins DSL脚本,它的版本来自pom。xml文件,并在nexusArtifactUploader中使用该版本。这目前不起作用,我正在
“groovy.lang.MissingPropertyException:无此类属性:类的版本:groovy.lang.Binding”
错误我是Groovy/Jenkins DSL的新手,不知道如何让它工作。
stage('Nexus') {
steps {
script {
def pom = readMavenPom file: 'pom.xml'
echo pom.version
nexusArtifactUploader(
nexusVersion: 'nexus3',
protocol: 'http',
nexusUrl: 'nexus.example.com:8080/nexus',
groupId: 'com.example',
**version: "${pom.version}",**
repository: 'example',
credentialsId: 'ciuser',
artifacts: [
[artifactId: 'com.example',
file: 'com.example-' + version + '.jar',
type: 'jar']
]
)
}
}
}