Chapter 16. Writing your own plugin
This chapter covers
- Understanding SonarQube architecture
- Writing code for a SonarQube plugin
- Creating your own widgets
- Supporting new languages
Welcome to the last chapter of SonarQube in Action, which will teach you how to implement your own SonarQube plugins. If you wonder why you might want to write your own plugin, here’s a non-exhaustive list of possible needs:
- Integrate SonarQube with external tools such as the example we’ll show you in this chapter.
- Create customized reports based on the metrics computed by SonarQube.
- Translate SonarQube in a new language (localization).
- Add support for a new programming language.
We’ve told you that SonarQube isn’t Java-centric and that even though our examples are Java-based, the same ideas apply to other languages. From an analysis standpoint, that’s true; but in this chapter, that changes. What we’re going to show you requires you to be familiar with Java, jRuby, and Ruby on Rails, because these are the languages currently supported for plugin writing in SonarQube. You’ll also be using Maven to build your plugin, but we’ll feed you the commands, so only a passing familiarity with Maven is required.