Issue
I am running a declarative pipeline like this -
stage ('Integration Tests') {
steps {
bat "mvn clean verify"
}
}
How can I fail this pipeline if integration tests fail? I have tried wrapping the step inside a script
with try-catch
block but that did not help. I am using JBehave Maven plugin to trigger integration tests.
Solution
JBehave Maven plugin has a flag ignoreFailureInStories
that needed to be set as true in my case.
Answered By - Saikat