sonarlint4bluej is a BlueJ plugin that introduces the SonarLint code analysis tool to BlueJ. (Java only) The plugin provides clear feedback with remediation guidance on flaws such as code smells, bugs and security vulnerabilities.
- Download the latest version of the extension found here
- Move the downloaded JAR to a BlueJ extensions2 directory
- Start BlueJ
BlueJ Extensions can be installed in three different directories:
User directory
installs for this userSystem directory
installs for all users of this systemProject directory
installs for this project only
To install for a project, make a directory called extensions2
in the projects root directory and move the JAR to that directory.
In order to install for a user/system place the JAR in one of these directories:
Operating System | Install-type | Directories |
---|---|---|
Mac | User | $HOME/Library/Preferences/org.bluej/extensions2 |
System | <BLUEJ_HOME>/BlueJ.app/Contents/Resources/Java/extensions2 |
|
Unix | User | $HOME/.bluej/extensions2 |
System | <BLUEJ_HOME>/lib/extensions2 |
|
Windows | User | %USERNAME%\bluej\extensions2 |
System | %PROGRAMFILES%\BlueJ\lib\extensions2 |
Tip: For Mac users, Control-click BlueJ.app and choose Show Package Contents to find the system directory.
For further information about Extensions in BlueJ see: BlueJ Extensions
The SonarLint Plugin runs checks in BlueJ when a Project/Package is opened and when a class file's state changes.
You can view the violations discovered by choosing Show SonarLint overview
from the Tools
menu.
Rules can be excluded from Code Analysis by disabling them through the BlueJ preferences.
You can find the preferences by choosing Preferences...
from the Tools
menu and navigating to the Extensions
tab.
Are you experiencing bugs/problems using this plugin?
Submit a bug report with detailed reproduction steps.
We also appreciate ideas of enhancements and new features, feel free to suggest new features here.
Contributions are welcome. Feel free to discuss the changes with us in a feature request before submitting a Pull Request.
This plugin relies on the usage of the BlueJ Extensions2 API. The latest version is added to this repository in the lib
directory.
The bluejext2 jar is bundled with the BlueJ installation, it can be retrieved from there. Detailed instructions can be found in the BlueJ documentation.
A toolscript is available for Windows users to update the API, it can also be used as a reference as on how to install new versions of the API to the lib directory.
The current version of the API is version 3.2, from version 5.0.2 of BlueJ.
Note: the script assumes BlueJ is installed for all users.
A lot of core functionality for this plugin is provided by BlueJ-Linting-Core, feel free to take a look at it as well.