I have a Java 8 project build using gradle 1.12 which works perfect. Now I want to use FindBugs and as I use Java 8 I have to use FindBugs 3. But the build hangs in findbugsMain
:
:my-module:compileJava UP-TO-DATE
:my-module:processResources UP-TO-DATE
:my-module:classes UP-TO-DATE
> Building 6% > :my-module:findbugsMain
The resulting build.gradle contains the following:
apply plugin: 'java'
apply plugin: 'findbugs'
findbugs.toolVersion = '3.0.0'
dependencies {
compile 'com.google.code.findbugs:annotations:3.0.0'
…
}
Any Idea why the build is getting hanged? What should I do?
The preferred method of running FindBugs is to directly execute $FINDBUGS_HOME /lib/findbugs. jar using the -jar command line switch of the JVM (java) executable. (Versions of FindBugs prior to 1.3. 5 required a wrapper script to invoke FindBugs.)
FindBugs support is deprecated, because project is abandoned. Use SpotBugs successor project instead. By default, quality plugin will activate SpotBugs and not findbugs.
To use checkstyle in Gradle you have add the plug-in to your build. gradle and provide a config\checkstyle\checkstyle. xml checkstyle configuration file. A detailed example is given in the checkstyle with Gradle exercise.
A plugin is simply any class that implements the Plugin interface. Gradle provides the core plugins (e.g. JavaPlugin ) as part of its distribution which means they are automatically resolved. However, non-core binary plugins need to be resolved before they can be applied.
Ok, after all it seems that findbugs 3 simply does not work with gradle 1.x!
After switching to gradle 2.1 all works fine.
Thanks to Peter Niederwieser!
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