How to configure CheckStyle and Findbugs plugins to IntelliJ IDEA for WSO2 products

Jayanga Kaushalya
Nov 29, 2016 · 3 min read

From WSO2 POM version 4 onward, CheckStyle and Findbugs maven plugins are enabled by default. So the code won’t compile if there are any CheckStyle or Findbugs issues present. Maven will complain about what are the issues there with the code. Until you fix everyone of them, you won’t be able to compile the code. (Of course you can disable CheckStyle and Findbugs) You can easily fix these issues beforehand by integrating CheckStyle and Findbugs plugins to IntelliJ IDEA.

Installing CheckStyle Plugin

First download the latest plugin (Or the version that is compatible with IDEA version) from plugins website. Then install it to the IDEA by opening File -> Settings -> Plugins and Install plugin from the disk.

After installing it, Restart the IDEA. Then go to File -> Settings -> Other Settings -> Checkstyle. Click positive mark to add a new configuration file. Select “Check style file accessible via HTTP” option and add https://raw.githubusercontent.com/wso2/code-quality-tools/master/checkstyle/checkstyle.xml URL.

Click next and save the configuration. Now the CheckStyle plugin will be available and you can run it in the project to find the issues.

NOTE:

If you are using a newer version of CheckStyle plugin ( > v4.35.0), then you will get an error if you try to directly add this URL. Reason for this is check style version for the file is 7.1 and newer versions of the plugin expects higher version file. To change that, first go to the plugin and change the check style version to 7.1 and hit apply. Then add the URL. Below screen shot is from the CheckStyle plugin version 5.17.0

Installing Findbugs Plugin

Download the Findbugs plugin from the site and install it by following the same steps mentioned above.

After installing the plugin, restart the IDEA and go to File -> Settings -> Other Settings -> FindBugs-IDEA. Then go to Report tab and select “Maximal” for the “Analysis Effort” and “Low” for the “Minimum confidence to report”

After that, you can run the Findbugs on the project and find what are the issues.

Jayanga Kaushalya

Written by

Software Engineer @WSO2

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade