Subject: Exported From Confluence
Content-Type: text/html; charset=UTF-8
To create a SonarQube plugin, you need Java 6 or later. Maven=
is required to compile and package the plugin.
Creating a New Plugin
The recommended way is to duplicate one of the examples located in the <=
em>plugins directory of the following GitHub repository: https://github.com/SonarSource/sonar-examples. If you a=
ren't sure which plugin to use, then select plugins/sonar-reference-plugin.=
There are two ways to copy the example:
- if you have Git, just clone the repository
- if you don't have Git, download the repository at https://github.com/SonarSource/sonar-examples/zipball/mas=
Building and Deployin=
g a Plugin
from the root directory, for example /path/to/sonar-reference-plugin. Th=
e JAR file is generated in the target directory.
Then, copy the JAR to the SONARQUBE_HOME/extensions/plugins dir=
ectory and restart your SonarQube server.
Next step is: co=
ding a plugin.
on SonarQube Eclipse Plugin in Eclipse
- clone https://github.com/SonarSource/sonar-=
- run an initial Maven build from the command line: mvn clean install
- import everything into Eclipse as a Maven project (the Tycho connector =
should be installed automatically)
- in Eclipse preferences, configure a new variable in Run/Debug > Stri=
ng substitution: M2_REPO =3D /path/to/your/local/m2/repo
- open and activate one of the following target platforms:
- If you want to work with Kepler: target-platform-e43/target-platform-e4=
- If you want to work with Juno: target-platform-e42/target-platform-e42-=
- you may have to use quick fix to ignore some m2e Lifec=
ycle execution not covered errors
At this point everything should be green in Eclipse, and you should be able=
to run/debug SonarQube Eclipse plugin.
If you're working in Linux, consider =
using Kepler. We find it to be more stable than Juno on Linux.