There's no *easy* way to do this - in Declarative + Blue Ocean, we now have this capability, but it relies on adding some additional metadata to the "failed" stage that Blue Ocean reads. That said, if you don't care about the visualization (i.e., the stage is marked as passed in Blue Ocean or the Stage View, the build continues, but at the end of the build the whole build is marked as failed), catchError will do the trick - https://jenkins.io/doc/pipeline/steps/workflow-basic-steps/#code-catcherror-code-catch-error-and-set-build-result
A. On Tue, Jan 3, 2017 at 8:10 AM, 'Stefan Golas' via Jenkins Users < jenkinsci-users@googlegroups.com> wrote: > Hello, > I would like to fail a stage in a pipeline job without aborting the build > (pipeline). Is there a way? > > regards Stefan > > -- > You received this message because you are subscribed to the Google Groups > "Jenkins Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to jenkinsci-users+unsubscr...@googlegroups.com. > To view this discussion on the web visit https://groups.google.com/d/ > msgid/jenkinsci-users/6cfbefd9-99da-40a1-afe2-5005c72a5b5f%40googlegroups. > com > <https://groups.google.com/d/msgid/jenkinsci-users/6cfbefd9-99da-40a1-afe2-5005c72a5b5f%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Jenkins Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CAPbPdOaBtwn6HoC5KpXpMjfEBzPH48Zv5SHqJzVtw9dF_0yMdA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.