Reputation: 4368
I have started porting my existing Jenkins
job to Jenkins
Pipeline
.
When it came to port the Scan for compiler warning
in Post-build action
, I started getting issues.
First I tried to port PC-Lint
. Used the following code
stage ('Warnings pclint') {
steps {
timeout(time: 5, unit: 'MINUTES') {
sh 'npm run lint:ci'
step([$class: 'WarningsPublisher',
parserConfigurations: [[
parserName: 'PC-Lint',
pattern: 'pmd.xml'
]],
unstableTotalAll: '0',
usePreviousBuildAsReference: true
])
}
}
}
But it didn't work. What is wrong in this ?
Is there any other way to do this ?
Upvotes: 0
Views: 720
Reputation: 4368
After searching a lot finally I got a working syntax.
step([$class: 'WarningsPublisher',
consoleParsers: [[parserName:'PC-Lint']],
defaultEncoding: '',
excludePattern: '',
healthy: '',
includePattern: '',
messagesPattern: '',
unHealthy: '',
useStableBuildAsReference: true
])
It is good to have this in the post build section of the Pipeline
Upvotes: 1