Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Releasing Hudson Plugin"

(Announcing your Plugin and the Wiki page)
 
(2 intermediate revisions by 2 users not shown)
Line 2: Line 2:
  
 
However, directly publishing to maven central is not allowed. Every one publishes to a intermediate Nexus repository where they have account and access. Then the artifacts from that repository get pushed to maven central. Hudson project uses OSS Nexus repository.
 
However, directly publishing to maven central is not allowed. Every one publishes to a intermediate Nexus repository where they have account and access. Then the artifacts from that repository get pushed to maven central. Hudson project uses OSS Nexus repository.
== Publishing your plugin to OSS Nexus repository ==
+
== Publishing your plugin to [https://oss.sonatype.org/ OSS Nexus repository] ==
  
 
To publish to Nexus OSS Repository you need an account.
 
To publish to Nexus OSS Repository you need an account.
Line 9: Line 9:
 
#Create a JIRA issue to get permission to publish to OSS Nexus repository
 
#Create a JIRA issue to get permission to publish to OSS Nexus repository
  
Read the document Sonatype OSS Maven Repository Usage Guide for more details
+
Read the document [https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide Sonatype OSS Maven Repository Usage Guide] for more details
 
== Setting up PGP Key ==
 
== Setting up PGP Key ==
  
This step is one time setup. In order to publish to OSS Nexus repository, you need a valid PGP key published to a key server. Read this article on how to set up your PGP key. If you set up a Pass Phrase for your PGP key, you could add it to your settings file (~/.m2/settings.xml) as shown below.  
+
This step is one time setup. In order to publish to OSS Nexus repository, you need a valid PGP key published to a key server. [https://docs.sonatype.org/display/Repository/How+To+Generate+PGP+Signatures+With+Maven Read this article] on how to set up your PGP key. If you set up a Pass Phrase for your PGP key, you could add it to your settings file (~/.m2/settings.xml) as shown below.  
 
<pre>
 
<pre>
 
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
Line 127: Line 127:
 
== Releasing to Maven Central ==
 
== Releasing to Maven Central ==
  
*Next Step is to release it.  
+
*[https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide#SonatypeOSSMavenRepositoryUsageGuide-8.ReleaseIt Next Step is to release it].  
*Login in to Nexus OSS . Click on the Staging Repositories at the left had side bar. Select the checkbox corresponding to your plugin. Click close to stage your plugin
+
*[https://oss.sonatype.org/ Login in to Nexus OSS] . Click on the Staging Repositories at the left had side bar. Select the checkbox corresponding to your plugin. Click close to stage your plugin
*Verify your plugin artifacts that appear at the OSS Nexus staging area
+
*Verify your plugin artifacts that appear at the [https://oss.sonatype.org/content/repositories/staging/org/jvnet/hudson/plugins/ OSS Nexus staging area]
*Once the staging is satisfactory, click on the release button to  push from OSS Nexus staging area to Maven Central
+
*Once the staging is satisfactory, [https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide#SonatypeOSSMavenRepositoryUsageGuide-8.ReleaseIt click on the release button] to  push from OSS Nexus staging area to [http://repo1.maven.org/maven2/org/hudsonci/plugins Maven Central]
 +
 
 +
 
 +
Once your plugin is released it need to be uploaded to the [http://hudson-ci.org/PluginCentral/ Plugin Central] for it to be included in the Hudson update center. Currently Hudson team monitors the release and uploads the plugin. In the future the plugin developers will get an account in the Plugin Central, so that they can manage their own plugins.
  
Once your plugin appears in the maven central repository (wait for couple of hours after pressing the release button), it will be included in the Hudson update center. An update center generator tools runs periodically to generate the Hudson Update Center JSON file from http://repo1.maven.org/maven2/org/hudsonci/plugins.
 
 
== Announcing your Plugin and the Wiki page ==
 
== Announcing your Plugin and the Wiki page ==
  
 
To ensure that your plugin details are available on the Hudson wiki you need to do the following. If you are unable to create a page, request wiki-edit permission via the Dev mailing list
 
To ensure that your plugin details are available on the Hudson wiki you need to do the following. If you are unable to create a page, request wiki-edit permission via the Dev mailing list
  
#Create a stub page on the Hudson wiki (go here)
+
#Create a stub page on the Hudson wiki (go [http://wiki.hudson-ci.org/display/HUDSON/Plugins here])
 
#Add the hudson-plugin-info and excerpt macros to the page - these pull information from the Update Center JSON file:<br> <code>{hudson-plugin-info:<yourpluginID>{color:#ff6600}}</code><i>a quick description of your plugin that will be included in the 'plugins by topic' wiki page too</i>
 
#Add the hudson-plugin-info and excerpt macros to the page - these pull information from the Update Center JSON file:<br> <code>{hudson-plugin-info:<yourpluginID>{color:#ff6600}}</code><i>a quick description of your plugin that will be included in the 'plugins by topic' wiki page too</i>
#Add labels to your page to denote the plugin's tier: <code>tier1-plugin, tier2-plugin, tier3-hudson-plugin</code> (if the plugin is for Hudson only), <code>tier3-compat-plugin</code> (if compatible with both Hudson and Jenkins), <code>tier3-installtest-plugin</code> (if the plugin has been tested for install on Hudson, but not for full working compatibility) to denote the topic it will be presented under in this page  
+
#Add labels to your page to denote the plugin's tier: <code>tier1-plugin, tier2-plugin, tier3-hudson-plugin</code> (if the plugin is for Hudson only), <code>tier3-compat-plugin</code> (if compatible with both Hudson and Jenkins), <code>tier3-installtest-plugin</code> (if the plugin has been tested for install on Hudson, but not for full working compatibility) to denote the topic it will be presented under [http://wiki.hudson-ci.org/display/HUDSON/All+Plugins+by+Topic in this page]
 
#Add description/configuration information to the wiki or point to the external source of such documentation
 
#Add description/configuration information to the wiki or point to the external source of such documentation
  
Line 146: Line 148:
 
== Want More Help? ==
 
== Want More Help? ==
  
In his blog Henrik Lynggard Hansen has explain his experience with releasing the Project Health Report plugin. This four part blog is a very useful resource.
+
In his blog Henrik Lynggard Hansen has explain his experience with releasing the [[Project Health Report]] plugin. This four part blog is a very useful resource.
  
Part 1: Getting access
+
# [http://blog.hlyh.dk/2011/04/supporting-both-hudson-jenkins-part-1.html Getting access]
Part 2: Settings.xml and the pom.xml
+
# [http://blog.hlyh.dk/2011/04/supporting-both-hudson-jenkins-part-2.html Settings.xml and the pom.xml]
Part 3: The Release process
+
# [http://blog.hlyh.dk/2011/04/supporting-both-hudson-jenkins-part-1_18.html The Release process]
Part 4: Post release work
+
# [http://blog.hlyh.dk/2011/04/supporting-both-hudson-jenkins-part-4.html Post release work]

Latest revision as of 18:06, 5 August 2014

Maven central is the place where ultimately all maven artifacts gets published. Hudson plugins should end up here (if the groupid of your plugin is org.hudsonci.plugins)

However, directly publishing to maven central is not allowed. Every one publishes to a intermediate Nexus repository where they have account and access. Then the artifacts from that repository get pushed to maven central. Hudson project uses OSS Nexus repository.

Publishing your plugin to OSS Nexus repository

To publish to Nexus OSS Repository you need an account.

  1. Signup for a Sonatype JIRA account. The Sonatype JIRA credentials will be same as Nexus OSS account
  2. Create a JIRA issue to get permission to publish to OSS Nexus repository

Read the document Sonatype OSS Maven Repository Usage Guide for more details

Setting up PGP Key

This step is one time setup. In order to publish to OSS Nexus repository, you need a valid PGP key published to a key server. Read this article on how to set up your PGP key. If you set up a Pass Phrase for your PGP key, you could add it to your settings file (~/.m2/settings.xml) as shown below.

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
..
..
<profiles>
    <profile>
      <id>development</id>
      <properties>
        <gpg.passphrase>{Your PGP key Pass Phrase}</gpg.passphrase>
       </properties>
    </profile>
</profiles>

<activeProfiles>
  <activeProfile>development</activeProfile>
</activeProfiles>
..
..
</settings>

If you don't want to put it in settings.xml file, other option is to pass it to the maven release:perform command using -Dgpg.passphrase=<pass-phrase>

Specifying your OSS Nexus repository credentials

This is also a one time setup. For pushing your plugin to OSS Nexus repository, maven need to know your credentials. You could permanently add it the settings file (~/.m2/settings.xml).

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">

  ..
  ..
  <servers>
    <server>
      <id>sonatype-nexus-snapshots</id>
      <username>your-sonatype-jira-id</username>
      <password>your-sonatype-jira-pwd</password>
    </server>
    <server>
      <id>sonatype-nexus-staging</id>
      <username>your-sonatype-jira-id</username>
      <password>your-sonatype-jira-pwd</password>
    </server>
  </servers>
  ..
  ..

 </settings>

If you don't want to put it in settings.xml file, other option is to pass it to the maven release:perform command using -Dusername and -Dpasseord Adding the Nexus OSS repository information to your POM

Adding the Nexus OSS release repository information in your POM is easy. Just include the following in your plugin POM where the distribution management information is specified

  <parent>
    <groupId>org.jvnet.hudson.plugins</groupId>
    <artifactId>hudson-plugin-parent</artifactId>
    <!-- The version of hudson platform  -->
    <version>1.398</version>
  </parent

Note: You need version 1.398 or later to deploy to OSS Nexus repository. If you are using older version then you should add the following to your plugin

  <distributionManagement>
         <snapshotRepository>
             <id>sonatype-nexus-snapshots</id>
             <name>Sonatype Nexus Snapshots</name>
             <url>${sonatypeOssDistMgmtSnapshotsUrl}</url>
         </snapshotRepository>
         <repository>
             <id>sonatype-nexus-staging</id>
             <name>Nexus Release Repository</name>
             <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
         </repository>
  </distributionManagement>

Specifying SCM information

Specify the SCM information where your plugin is hosted. You need this for maven-release-plugin to create the release tag in your SCM.

<scm>
    <connection>scm:git:git://github.com/hudson/hudson.git</connection>
    <developerConnection>scm:git:ssh://git@github.com/hudson/hudson.git</developerConnection>
    <url>https://github.com/hudson/hudson</url>
</scm>

Specifying the sections where your plugin should appear in the update center

Update center displays the plugins under certain sections. In order to specify under which sections your plugin should appear add the property <hudsonTags> to your pom.xml. For example:

   <groupId> .. </groupId>
   <artifactId> .. </artifactId>
   ..
   <properties>
       <hudsonTags>scm,builder</hudsonTags>
   </properties>
   ..

Staging your release

Stage the release of your plugin using maven commands

mvn release:clean
mvn release:prepare -DpushChanges=false

The two steps above prepare your plugin for releasing. It creates a release tag as specified by you in the release prepare step.

mvn release:perform -DlocalCheckout=true

Maven will checkout the release tag locally, then build and deploy it into Nexus staging repository.

In the above case, maven modifies POM file and creates the release tag etc, but does not push to the origin, but commits locally and checkouts locally. Once the release is done successfully, you have to manually push the commits and the tag created during the release.

Releasing to Maven Central


Once your plugin is released it need to be uploaded to the Plugin Central for it to be included in the Hudson update center. Currently Hudson team monitors the release and uploads the plugin. In the future the plugin developers will get an account in the Plugin Central, so that they can manage their own plugins.

Announcing your Plugin and the Wiki page

To ensure that your plugin details are available on the Hudson wiki you need to do the following. If you are unable to create a page, request wiki-edit permission via the Dev mailing list

  1. Create a stub page on the Hudson wiki (go here)
  2. Add the hudson-plugin-info and excerpt macros to the page - these pull information from the Update Center JSON file:
    {hudson-plugin-info:<yourpluginID>{color:#ff6600}}a quick description of your plugin that will be included in the 'plugins by topic' wiki page too
  3. Add labels to your page to denote the plugin's tier: tier1-plugin, tier2-plugin, tier3-hudson-plugin (if the plugin is for Hudson only), tier3-compat-plugin (if compatible with both Hudson and Jenkins), tier3-installtest-plugin (if the plugin has been tested for install on Hudson, but not for full working compatibility) to denote the topic it will be presented under in this page
  4. Add description/configuration information to the wiki or point to the external source of such documentation

Finally, announce your plugin on the Hudson Developer list. If your plugin is hosted outside of Hudson be sure to include that in the announcement so that it can included in the Update Center JSON script.

Want More Help?

In his blog Henrik Lynggard Hansen has explain his experience with releasing the Project Health Report plugin. This four part blog is a very useful resource.

  1. Getting access
  2. Settings.xml and the pom.xml
  3. The Release process
  4. Post release work

Back to the top