Can I use ErrorProne to create custom annotation processor without adding it to ErrorProne? #4190
-
The Writing a check page outlines how to create a custom check into ErrorProne. Is it possible to build a check specialized for a particular 3rd-party class (e.g. to prevent misuse), and package it up as a separate annotation processor without adding it as part of core ErrorProne? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 2 replies
-
You'll want to build a "plugin check" then, see https://errorprone.info/docs/plugins |
Beta Was this translation helpful? Give feedback.
-
Thanks for the pointer! I was able to get a basic checker plugin, but third-party dependency doesn't work.
It didn't complain about Guava classes though (and I'm setting Guava and the third-party dependency the same way in the pom file). That makes me wonder if Error-Prone (or |
Beta Was this translation helpful? Give feedback.
-
The tests pass now. Though the annotation processor doesn't seem to do anything. Here's how I add it as annotation processor in the pom file:
But the check is not detecting any error. Is there any configuration I need to do within the
|
Beta Was this translation helpful? Give feedback.
-
Do you have AutoService configured on the |
Beta Was this translation helpful? Give feedback.
You'll want to build a "plugin check" then, see https://errorprone.info/docs/plugins