Versions Compared


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



  • The plugin must support Java 5 (Java 6 since March 2013). The Continuous Integration job uses Oracle JDK 6.
  • The plugin must be built with Maven 2.2.x or 3.x

Maven POM

  • The directory name is the plugin name
  • The groupId is org.codehaus.sonar-plugins and artifactId sonar-<name>-plugin. For example the plugin "foo" is stored in the directory foo and its artifact id is sonar-foo-plugin.
  • Set the following properties:

    Code Block
             The latest version can be found by looking at 
      <name>Plugin name</name>
      <description>Plugin description</description>
        <name>My Organization</name>

  • Configure your pom by overriding values provided by parent - see SonarQube Plugins Forge Parent POM. Default license is LGPL3.
  • Follow Maven POM conventions
  • Add the plugin to the main pom of the forge

Continuous Integration

Send an email to, so we can add register the plugin to Jenkinsat Cloudbees.


  • Do not commit incomplete changes (Git is not a backup system)
  • Do not commit IDE files (.settings, .project, .classpath, .idea, *.iml, *.ipr, *.iws)
  • Use meaningful comments when doing a commit, always with the JIRA key and title (e.g. "SONARPLUGIN-1234 add rule FOO") - see this note about Git commit messages
  • Subscribe to the mailing list
  • Overuse JUnit tests with the help of FEST Assert and Mockito
  • Use comments and javadocs only when necessary
  • Do not forget the license header on all Java and Ruby files
  • Source code encoding should be set to UTF-8 to prevent cross-platform encoding issues. UTF-8 is specified in parent POMs, so it is used by Maven when building the projects. However, it may not be set by default in your prefered IDE. The best practice is to force it for all your source code.
    • For Eclipse : go to "Preferences -> General -> Workspace" and force the "Text file encoding" to "UTF-8"
    • For IntelliJ IDEA : go to "Settings -> File Encodings" and force the "IDE Encoding" to "UTF-8"
  • Replace tab characters with 2 space characters
  • Be aware of the inspection analysis of plugins on Nemo

IDE Support


  1. Install Anyedit Eclipse Plugin
  2. Optional: if Maven projects do not define the profile ‘m2e’, then install the M2E error disabler plugin
  3. Restart Eclipse
  4. Windows → Preferences
    • General
      • Workspace
        • Text file encoding: UTF-8
      • Editors → AnyEdit Tools
        • Remove trailing whitespace
        • Create new line at the end of file
        • Convert tabs – spaces
        • Default convert mode on save: Tabs to spaces
    • Java → Code Style
    • XML → XML Files → Editor
      • Indent using spaces
      • Indentation size: 2
  5. Open the Maven project: File → Import → Maven → Existing Maven Projects → select the root directory containing the file pom.xml
IntelliJ IDEA
  1. Download sonar-codestyle.xml to
    • ~/Library/Preferences/IntellijIdea/codestyles/ on Mac OS
    • ~/.IntellijIdea/config/codeStyles/ on Linux
    • ~\.IntellijIdea\config\codeStyles\ on Windows
  2. (Re)start IntellIJ IDEA
  3. Open the Maven project: File → Open Project → select the file pom.xml
  4. Use UTF-8 encoding: Project Settings → File Encodings → IDE Encoding: UTF-8
  5. Change the Configure code style: Project Settings → Code Style → Scheme: sonar

Release Your Plugin

The release process is detailed on this page.