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:
- Hudson 2 - https://github.com/hudson2-plugins
- Hudson 3 - https://github.com/hudson3-plugins
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 are a member of the Hudson Plug-in Development team, including:
- permissions to publish release artifacts on https://oss.sonatype.org/content/repositories/releases/org/hudsonci/plugins/clover
- write permissions in master git repository on https://github.com/hudson3-plugins/clover-plugin
- account on Hudson Wiki in order to edit the http://wiki.hudson-ci.org/display/HUDSON/Clover+Plugin page
- 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
- Clone the git@github.com/hudson3-plugins/clover-plugin.git
- Create a bug on https://bugs.eclipse.org (Hudson project, Plugins component) for the issue you are fixing.
- Make the necessary changes
- Bump the plug-in version number (in pom.xml).
Bump the com.atlassian.clover: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. - 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- it starts Hudson on localhost:8080 by default, open it in web browser
- open "Manage Hudson" > "Manage plugins" > "Installed" and check if new "Hudson Clover Plugin" is listed
- configure new project (you can use MoneyBags as a test case) and a build job (e.g. "freestyle project" with "ant task")
- configure "Post-build actions" > "Publish Clover Coverage Report" in the build job
- run "Build now" and check if Clover summary report is available
- 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:
- Go to your local clover-plugin workspace and type
mvn release:clean
mvn release:prepare -DpushChanges=false
mvn release:perform -DlocalCheckout=true - Login to OSS Nexus, open Staging Repositories, click "Close" button.
- Download clover-X.X.X.hpi from OSS Nexus staging area and install and test it in your standalone Hudson instance.
- If works OK, git push changes from your local workspace to hudson3-plugins/clover-plugin and click "Release" button on Nexus OSS.
- 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.