需要一些我正在运行的groovy脚本的帮助。我试图将其整合为Jenkins管道中的工作。脚本中失败的方法是:
private void blackduckTestJob(def blackduckTestJob){
blackduckTestJob.with {
description("This job runs dependency checks for the Java reference application using blackduck.")
logRotator this.logRotator.getLogRotator()
wrappers{
preBuildCleanup()
maskPasswords()
credentialsBindings{
usernamePassword('BLACKDUCK_USERNAME','BLACKDUCK_PASSWORD', this.service.getBlackduckCredentialsId())
}
}
steps {
copyArtifacts(this.getProjectFolder() + "/" + this.service.getComponentName() + "/${this.service.getComponentName()}_Application_Build") {
buildSelector {
buildNumber('${B}')
}
}
shell('''
#!/bin/bash
set +x
chmod +x ./mvnw ; ./mvnw com.blackducksoftware.integration:hub-maven-plugin:2.0.2:build-bom -Dhub.url=${BLACKDUCK_URL} -Dhub.username=${BLACKDUCK_USERNAME} -Dhub.password=${BLACKDUCK_PASSWORD}''')
}
}
}
我得到的错误是:
ERROR: (JavaMicroservicePipelineComponent.groovy, line 154) No signature of method: JavaMicroservicePipelineComponent.description() is applicable for argument types: (java.lang.String) values: [This job runs dependency checks for the Java reference application using blackduck.]
完成:失败
如果有人可以提供任何帮助或建议,那将非常有帮助!
答案 0 :(得分:1)
错误告诉您JavaMicroservicePipelineComponent
不包含description(String)
方法。您正在调用不存在的方法。