As you might know, SuppressFBWarnings
annotations are retained in the class files, but aren't needed on runtime, so FindBugs doesn't become a runtime dependency of your project. Unfortunately, those reatined annotations cause compilation warnings like this for Gradle users who use the project as dependency:
warning: Cannot find annotation method 'value()' in type
'SuppressFBWarnings': class file for
edu.umd.cs.findbugs.annotations.SuppressFBWarnings not found
Note that Maven users don't get any warnings (with the default javac configuration). But of course I can't ignore Gradle users.
So it seems I have to remove those annotations from the release builds somehow. But I can't find any existing solution, which is strange. How do others deal with this problem?
With Gradle, you can get rid of such warnings from released Jars via,
compileOnly 'com.google.code.findbugs:annotations:3.0.1'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With