Hudson Clover Plugin Developer Guide

Hudson was migrated to the Eclipse Foundation. It's being hosted on the http://eclipse.org/hudson/ site (mailing list hudson-dev@eclipse.org). The old site http://hudson-ci.org/ is still available and hosts plugins not under by EPL license (including Clover-for-Hudson). Sources were forked into two streams:

Please note that Hudson 2 is not actively developed anymore, so we recommend to focus on maintaining Clover plugin for Hudson 3.

Hudson 2

  • source repository is here: git@github.com/hudson2-plugins/clover-plugin.git 
  • you can run Hudson with the Clover plug-in installed via:
    mvn clean hpi:run
    • it starts Hudson on localhost:8080 by default, open it in a web browser
    • open "Manage Hudson" > "Manage plugins" > "Installed" and check if new "Hudson Clover Plugin" is listed

Hudson 3

Preconditions

  • You have proper credentials in ~/.m2/settings.xml
<server>
    <id>sonatype-nexus-snapshots</id>
    <username>xxxxxx</username>
    <password>xxxxxx</password>
</server>
<server>
    <id>sonatype-nexus-staging</id>
    <username>xxxxxx</username>
    <password>xxxxxx</password>
</server>
  • JAVA_HOME points to JDK1.6+
  • M2_HOME points to Maven 3.0.4+ (otherwise checksum validation will fail on OSS)
  • You have GPG signature configured to sign artifacts

Build and test

  1. Clone the git@github.com/hudson3-plugins/clover-plugin.git
  2. Create a bug on https://bugs.eclipse.org (Hudson project, Plugins component) for the issue you are fixing.
  3. Make the necessary changes
  4. Bump the plug-in version number (in pom.xml).
    Bump the org.openclover:clover version number if necessary (in pom.xml).
    Try to avoid bumping org.eclipse.hudson.plugins:hudson-plugin-parent version to ensure compatibility with version 3.0.0 upwards.
  5. Test by running Hudson with the Clover plugin installed and setting up a "Clovered" project for CI. This can be achieved via:
    mvn clean hpi:run
    1. it starts Hudson on localhost:8080 by default, open it in web browser
    2. open "Manage Hudson" > "Manage plugins" > "Installed" and check if new "Hudson Clover Plugin" is listed
    3. configure new project (you can use MoneyBags as a test case) and a build job (e.g. "freestyle project" with "ant task")
    4. configure "Post-build actions" > "Publish Clover Coverage Report" in the build job
    5. run "Build now" and check if Clover summary report is available
  6. Commit changes and push to GitHub. Include your Bugzilla bug ID from above in the commit line. 

Release and publish

Detailed instruction here. If this is your first time publishing a Hudson release, allow at least a day or two for Sonatype to process your JIRA requests, set you up and eventually enable Central Sync.

Steps in short:

  1. Go to your local clover-plugin workspace and type
        mvn release:clean
        mvn release:prepare -DpushChanges=false
        mvn release:perform -DlocalCheckout=true
  2. Login to OSS Nexus, open Staging Repositories, click "Close" button.
  3. Download clover-X.X.X.hpi from OSS Nexus staging area and install and test it in your standalone Hudson instance.
  4. If works OK, git push changes from your local workspace to hudson3-plugins/clover-plugin and click "Release" button on Nexus OSS.
  5. Update the content of HUDSON/Clover+Plugin wiki page.

Tips

How to see the latest version in Hudson Plugin Manager? Where's the magic?

Once your plugin appears in the Maven Central repository, send an email to Hudson admins (e.g. on Hudson-dev mailing list) and ask them to upload new version to Hudson Update Centre (note that for there are several update centres, each for different version of Hudson core), e.g.: 

After this, the latest plugin version will be seen in the Plugin Manager in the Hudson administration panel.