How do I fail a gitlab pipeline job?

HOW TO -️ October 18, 2021

I am currently using dependency checker to scan my applications via gitlab

This is how my pipeline looks like.

ERROR Rendering Code Block

And this is my output.

ERROR Rendering Code Block

Is it possible to make my pipeline fail even though it is success, in this case when vulnerabilities are present?


A a very general tip, exit 1 (or any non 0 rc) anywhere in you pipeline should fail it. So you could detect what comes back from your previous command and exit with error when need be. Meanwhile, I'm not very familiar with the maven dependency-check plugin, but I'm quite sure you have a configuration option or a specific way to call it that will let it exit with an error code itself if a vulnerability is found.