Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 18 Next »

Prerequisites

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

Create Plugin

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

There are two ways to copy the example :

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

Build Plugin

Simply execute

from the root directory, for example /path/to/sonar-reference-plugin

The JAR file is generated in the directory /target.

Deploy Plugin

Copy the generated JAR file to the Sonar directory /extensions/plugins then restart the server.

Next step is: coding the plugin.

  • No labels