1

How do i prevent my custom maven plugin to fail the build?

I do not want to the build to fail if there is an issue in the custom maven plugin. How do i implement that?

Any examples would be helpful.

I see but not sure how to configure that.

bigskull
  • 739
  • 2
  • 13
  • 23
  • 3
    If you want, you can catch all exceptions in the `execute` method and discard them. But is it really sensible to ignore everything that went wrong in your plugin? – J Fabian Meier Mar 23 '20 at 19:44

1 Answers1

0

Believing https://maven.apache.org/ref/3.6.3/maven-plugin-api/apidocs/org/apache/maven/plugin/Mojo.html#execute(), I would "simply" catch all exceptions. (In mojo.execute())

Advanced: Introduce a plugin parameter à la failOnError(/+failOnWarning) ...and catch/throw accordingly.

xerx593
  • 12,237
  • 5
  • 33
  • 64
  • Got it. Thank You. – bigskull Mar 23 '20 at 20:11
  • 1
    Please use up-to-date information https://maven.apache.org/ref/3.6.3/maven-plugin-api/apidocs/org/apache/maven/plugin/Mojo.html#execute(). (Maven 2.2.1 is long end of life)... – khmarbaise Mar 24 '20 at 00:17
  • 1
    ah, tyvm, @khmarbaise ... that's what google "offered first" ..updated! (and sort of "current" urls would be cool for maven (..SEO and as "improvement proposal")) – xerx593 Mar 24 '20 at 00:23