第一个配置:
stage('bug')
{ bat 'mvn findbugs:findbugs'
bat'mvn test'
findbugs canComputeNew: false, defaultEncoding: '', excludePattern:
'', healthy: '', includePattern: '', pattern:
'**/target/findbugsXml.xml', unHealthy: ''
}它在本地环境中工作正常。本地是Windows!但在生产环境中不起作用(RedHat)
第二个配置:
step([$class: 'FindBugsPublisher',
pattern:'C:\\Users\\ADMIN\\.jenkins\\workspace\\pipeline\\target\\findbugsXml.xml', unstableTotalAll:'0'])只要我注意到'\\‘,它就可以在本地(Windows)和生产环境中工作。
Pipeline也与我正在使用的插件兼容。
我想知道为什么第一个配置在生产环境中不起作用,而第二个配置在两个环境中都可以工作。
第一个配置抛出构建失败,并显示错误:
No Such DSL method findbugs found.有人能帮我解决这个问题吗?
发布于 2017-10-08 13:40:01
在Pipeline: Nodes and Processes中,bat步骤执行executes批处理脚本,而不是Linux (RedHat或其他)
对于ReadHat,请替换bat with sh。
这与Pipeline Maven Integration Plugin不同,后者会将maven调用转换为bat或外壳进程,具体取决于执行的操作系统。
https://stackoverflow.com/questions/46627688
复制相似问题