Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Prerequisites

To create a Sonar plugin, you need Java 6 or later. Maven is not required to build sources but it is highly recommended. Moreover this guide uses Maven to create and compile sources.

...

compile and package the plugin.

Creating a New Plugin

The recommended way is to duplicate one of the examples located in the 'plugins' directory /plugins of this the following GitHub repository: https://github.com/SonarSource/sonar-examples. If you don't know which one must be used, then select the plugins/sonar-reference-plugin.

There are two ways to copy the example:

  1. if you have Git, then just clone the repository
  2. if you don't have Git, download the repository at https://github.com/SonarSource/sonar-examples/zipball/master

...

Building and

...

Deploying a Plugin

Simply execute:

Code Block
mvn clean install

from the root directory, for example /path/to/sonar-reference-plugin. The JAR file is generated in the 'target' directory /target. It must be copied to the directory .

Then, copy the JAR to the '$SONAR_HOME/extensions/plugin of ' directory and restart your Sonar installation. The server must be restarted.

Next step is: coding a plugin.