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 :
- if you have Git, then clone the repository
- if you don't have Git, download the repository at https://github.com/SonarSource/sonar-examples/zipball/master
Build and Deploy Plugin
from the root directory, for example /path/to/sonar-reference-plugin. The JAR file is generated in the directory /target. It must be copied to the directory /extensions/plugin of your Sonar installation. The server must be restarted.
Next step is: coding the plugin.