Full documentation for SonarQube has moved to a new location: http://docs.sonarqube.org/display/SONAR

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 21 Next »

Tempted to go ahead and write your own plugin ? No obligation, but you might want to share it with the Sonar community. In that case hosting your plugin at sonar-plugins.codehaus.org brings you many benefits :

  • the community helps you more easily, as well as the community benefits from the plugin
  • free hosting in the subversion repository
  • use JIRA to track issues
  • use this wiki for the documentation
  • the plugin is automatically shown in the update center (feature to come soon), so users can install the plugin directly from the application 

Request hosting

  1. Create an account at Codehaus
  2. Subscribe to dev@sonar.codehaus.org
  3. Send e-mail to dev@sonar.codehaus.org and tell us your Codehaus ID, so that we can give you a commit access to subversion.

Principles

When you utilize the forge, we request that you respect the following principles :

  1. A plugin is built with Maven
  2. You should follow Best practices and Sonar Code Style.
  3. When you create a plugin called 'foo', it should be stored in the directory 'foo'. Maven groupId is 'org.codehaus.sonar-plugins' and artifactId is 'sonar-foo-plugin'.
  4. Add the plugin as a module of ../pom.xml
  5. After creation, send an email to the dev mailing for it to be added to Continuous Integration server (Bamboo)
  6. The copyright belongs to whoever wrote the plugin, however the license should be business friendly (see "Choose license" below)

Maven POM

  • The Maven group id is org.codehaus.sonar-plugins in pom.xml, but not org.codehaus.sonar.plugins
  • Use the following parent in your pom :
  • Set the following properties :
  1. Add the plugin to the main pom

Choose license

Starting from Sonar plugins parent POM version 4 we are using maven-license-plugin for checking and for managing license headers in source files (currently only java-files).

Here is a brief description of how we recommend to use this plugin :

  1. Define licenses, inceptionYear and organization in your pom.xml file :
  2. Place license-header.txt to your src directory (example of this file can be found here).
  3. Add/update headers of your source files :

For detailed instructions on how to use this plugin see plugin homepage.

Releasing a plugin

Configure Maven

  • Install Maven 2.0.x, not Maven 2.1+ (see MNG-4301)
  • Add your codehaus credentials to maven settings (~/.m2/settings.xml) :
  • Install Codehaus SSL certificates :
    • download startssl-CA.pem and startssl-Intermediate.pem from this page.
    • execute the command for both certificates (password is changeit):
    • add these properties to MAVEN_OPTS:

Prepare to Release

  • Make sure the wiki page is up to date
  • All JIRA issues included in the release should be closed
  • Plugin must be documented and preferably have tests
  • run mvn deploy in order to publish the snapshot version for tests

Call a Vote

Before a release can occur, a vote typically takes place. This is initiated with an email to the dev mailing list with a link to the snapshot version, preferably with a subject that starts with [VOTE]. Explain the plugin, status and any other info you feel relevant. The standard is to wait 72 hours for responses. This gives other developers time to verify the validity of the plugin before placing their vote. Votes are represented as numbers between -1 and +1, with -1 meaning 'no' and +1 meaning 'yes.'

Only Sonar plugin commiters can vote. To pass, a vote should :

  • have a minimum of three +1
  • have no -1

Perform the Release

  1. Close the vote on the dev mailing list
  2. Execute the following with Maven 2.0.x, not Maven 2.1+ (see MNG-4301) :
  3. Update the plugin page with new version info (the jar file is available under http://repository.codehaus.org/org/codehaus/sonar-plugins/)
  4. Update the Changelog using the jiraissues macro
  5. Release the version in JIRA
  6. Update the version compatibility matrix
  7. Announce the release in the mailing-lists announce@sonar.codehaus.org, user@sonar.codehaus.org and dev@sonar.codehaus.org (you must subscribe to these lists in xircles )
  8. Tweet it (big grin)
  • No labels