Differences between revisions 5 and 6
Revision 5 as of 2009-09-20 23:46:23
Size: 7528
Editor: localhost
Comment: converted to 1.6 markup
Revision 6 as of 2010-04-09 14:18:41
Size: 6620
Editor: AteDouma
Comment:
Deletions are marked like this. Additions are marked like this.
Line 5: Line 5:
These notes are intended to be used together with the Apache Portals portals-pom-1.2 or later: http://svn.apache.org/repos/asf/portals/portals-pom/tags/portals-pom-1.2/pom.xml These notes are intended to be used together with the Apache Portals portals-pom-1.3 or later: http://svn.apache.org/repos/asf/portals/portals-pom/tags/portals-pom-1.3/pom.xml
Line 7: Line 7:
The primary source and instructions are provided here: http://maven.apache.org/developers/release/releasing.html The primary source and instructions are provided here: http://maven.apache.org/developers/release/apache-release.html
Line 12: Line 12:
Line 16: Line 15:

''If you don't have the appropriate rights (but you should have) you might get a 401 error, in which case you need to contact the Apache Repository team to have it corrected.''    
  . ''If you don't have the appropriate rights (but you should have) you might get a 401 error, in which case you need to contact the Apache Repository team to have it corrected.''
Line 21: Line 19:
   ''Note: the '''main doc''' incorrectly uses the name '''release''' for this profile''
Line 31: Line 28:
             if you have multiple user-ids and need to use the not defauult user-id,
             specify gpg.keyname which will be passed on to gpg as --local-user 
             if you have multiple user-ids and need to use the not default user-id,
             specify gpg.keyname which will be passed on to gpg as --local-user
Line 36: Line 33:
             gpg.useAgent doesn't work although it is a documented property for the gpg-plugin               gpg.useAgent doesn't work although it is a documented property for the gpg-plugin
Line 38: Line 35:
        -->          -->
Line 45: Line 42:
 * Define the following required Apache Servers in your local maven settings ''(~/.m2/settings.xml)'', see also: http://maven.apache.org/developers/committer-settings.html
Line 46: Line 44:
 * Define the following required Apache Servers in your local maven settings ''(~/.m2/settings.xml)'', see also: http://maven.apache.org/developers/committer-settings.html
Line 81: Line 78:

 * Make sure your root project pom.xml inherits directly or indirectly from the Apache Portals portals-pom version 1.2 or later

 * Make sure as the minimum to have the following profile defined in your root project pom.xml:
{{{
  <profiles>
    <profile>
      <id>apache-release</id>
      <build>
        <plugins>
          <plugin>
            <!-- only include this in top level project poms -->
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-assembly-plugin</artifactId>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
}}}

  Note: there is an open issue for how we use and configure the maven-assembly-plugin in the portals-pom-1.2: http://issues.apache.org/jira/browse/PORTALS-16
 * Make sure your root project pom.xml inherits directly or indirectly from the Apache Portals portals-pom version 1.3 or later
Line 105: Line 81:
 * Make sure there are no snapshots in the POMs to be released
  . If you are staging multiple release candidates which are dependent, e.g project B-1.0-SNAPSHOT -> A-1.0-SNAPSHOT, you will have to manually update B-1.0-SNAPSHOT -> A-1.0 before you can start releasing project B through Nexus.
Line 106: Line 84:
 * Make sure there are no snapshots in the POMs to be released
   
   If you are staging multiple release candidates which are dependent, e.g project B-1.0-SNAPSHOT -> A-1.0-SNAPSHOT,
   you will have to manually update B-1.0-SNAPSHOT -> A-1.0 before you can start releasing project B through Nexus.
 
Line 115: Line 88:
 * RAT check your project sources required license headers using apache-rat-plugin (defined in the portals-pom) using: '''{{{mvn install -P rat}}}'''
Line 116: Line 91:
 * first make sure to start with a clean/pristine checkout of the project, run at least {{{mvn clean}}}
Line 117: Line 93:
  * first make sure to start with a clean/pristine checkout of the project, run at least {{{mvn clean}}}  * ''If you followed the advise in the '''main doc''' for the previous step by running ''{{{mvn release:prepare -DdryRun=true}}}'', make sure to run ''{{{mvn release:clean}}}'' first before continuing''
Line 119: Line 95:
  * ''If you followed the advise in the '''main doc''' for the previous step by running ''{{{mvn release:prepare -DdryRun=true}}}'', make sure to run ''{{{mvn release:clean}}}'' first before continuing''  * '''{{{mvn deploy}}}'''
  . If you experience an error during deployment like a HTTP 401 check your settings for the required server entries as outlined in the Prerequisites.
Line 121: Line 98:
  * '''{{{mvn deploy}}}'''

    If you experience an error during deployment like a HTTP 401 check your settings for the required server entries as outlined in the Prerequisites.

 
* verify the deployment under Maven Snapshot repository on Apache (Nexus: Repositories->Snapshots)
 * verify the deployment under Maven Snapshot repository on Apache (Nexus: Repositories->Snapshots)
Line 128: Line 101:
   * Make sure to start clean by running '''{{{mvn release:clean}}}'''  * Make sure to start clean by running '''{{{mvn release:clean clean}}}'''
Line 132: Line 104:
 If you experience a BUILD FAILURE because of svn failing to commit with an error message like: ''{{{svn: The specified baseline is not the latest baseline, so it may not be checked out.}}}'':
  * when using the SVN EU mirror it might occur when the SVN server sync hasn't been completed yet, causing the SVN EU mirror to be slightly out-of-sync temporarily
Line 133: Line 107:
 If you experience a BUILD FAILURE because of svn failing to commit with an error message like: ''{{{svn: The specified baseline is not the latest baseline, so it may not be checked out.}}}'':   * try running '''{{{svn up}}}''' and '''{{{mvn release:prepare}}}''' one or more times again, it usually completes successfully after one or more retry.
Line 135: Line 109:
    * when using the SVN EU mirror it might occur when the SVN server sync hasn't been completed yet, causing the SVN EU mirror to be slightly out-of-sync temporarily
    
    * try running '''{{{svn up}}}''' and '''{{{mvn release:prepare}}}''' one or more times again, it usually completes successfully after one or more retry.

  
* if it keeps failing, you can restart from scratch by running '''{{{mvn release:rollback}}}''' first, see also: http://maven.apache.org/plugins/maven-release-plugin
  * if it keeps failing, you can restart from scratch by running '''{{{mvn release:rollback}}}''' first, see also: http://maven.apache.org/plugins/maven-release-plugin
Line 142: Line 112:
Line 144: Line 113:

   This will create a new temporary Nexus staging repository and upload to it, or append to it if you are combining multiple release candidates together.
   This temporary staging repository, while still open (see next step) will only be visible and accessible by yourself until closed (next step).
   Once the staging repository is closed, you can no longer add more release candidates to it.

   See http://www.sonatype.com/books/nexus-book/reference/staging.html for further details.
  . This will create a new temporary Nexus staging repository and upload to it, or append to it if you are combining multiple release candidates together. This temporary staging repository, while still open (see next step) will only be visible and accessible by yourself until closed (next step). Once the staging repository is closed, you can no longer add more release candidates to it.
  See http://www.sonatype.com/books/nexus-book/reference/staging.html for further details.
Line 152: Line 117:
Line 154: Line 118:

The current '''''main doc''''' describe how to '''close''' your staging repository by using right click on the status field and choose '''{{{Finish}}}'''. However, for the current Nexus installation
this action menu item now is called '''{{{Close}}}'''.
Line 161: Line 122:
  

/!\ Under Construction /!\

This page provides some additional notes how to use Nexus for performing a release.

These notes are intended to be used together with the Apache Portals portals-pom-1.3 or later: http://svn.apache.org/repos/asf/portals/portals-pom/tags/portals-pom-1.3/pom.xml

The primary source and instructions are provided here: http://maven.apache.org/developers/release/apache-release.html

For the remainder of this page, the primary source will be referred to as the main doc.

Prerequisites:

  • Ensure you can login on https://repository.apache.org with your Apache SVN username and password

  • Ensure you have been given the appropriate rights on Nexus to access the Enterprise->Staging left-side menu item.

    • If you don't have the appropriate rights (but you should have) you might get a 401 error, in which case you need to contact the Apache Repository team to have it corrected.

  • Define the following GPG configuration setup in a profile named 'apache-release' within your local maven settings (~/.m2/settings.xml):

<settings>
  ...
  <profiles>
    <profile>
      <id>apache-release</id>
      <properties>
        <gpg.passphrase> <!-- YOUR KEY PASSPHRASE --> </gpg.passphrase>
        <!-- optional:
             if you have multiple user-ids and need to use the not default user-id,
             specify gpg.keyname which will be passed on to gpg as --local-user
        <gpg.keyname> YOUR LOCAL USER-ID TO SIGN </gpg.keyname>
        -->
        <!-- ignored:
             gpg.useAgent doesn't work although it is a documented property for the gpg-plugin
           <gpg.useAgent>true</gpg.useAgent>
        -->
      </properties>
    </profile>
  </profiles>
  ...
</settings>

<settings>
...
  <servers>
    <!-- To publish a snapshot of some part of Maven -->
    <server>
      <id>apache.snapshots.https</id>
      <username> <!-- YOUR APACHE SVN USERNAME --> </username>
      <password> <!-- YOUR APACHE SVN PASSWORD --> </password>
    </server>
    <!-- To publish a website of some part of Maven -->
    <server>
      <id>apache.website</id>
      <username> <!-- YOUR APACHE SSH USERNAME --> </username>
      <filePermissions>664</filePermissions>
      <directoryPermissions>775</directoryPermissions>
    </server>
    <!-- To stage a release of some part of Maven -->
    <server>
      <id>apache.releases.https</id>
      <username> <!-- YOUR APACHE SVN USERNAME --> </username>
      <password> <!-- YOUR APACHE SVN PASSWORD --> </password>
    </server>
    <!-- To stage a website of some part of Maven -->
    <server>
      <id>stagingSite</id> <!-- must match hard-coded repository identifier in site:stage-deploy -->
      <username> <!-- YOUR APACHE SSH USERNAME --> </username>
      <filePermissions>664</filePermissions>
      <directoryPermissions>775</directoryPermissions>
    </server>
    ...
  </servers>
</settings>
  • Make sure your root project pom.xml inherits directly or indirectly from the Apache Portals portals-pom version 1.3 or later

Step 1: Prepare your POMs for release

  • Make sure there are no snapshots in the POMs to be released
    • If you are staging multiple release candidates which are dependent, e.g project B-1.0-SNAPSHOT -> A-1.0-SNAPSHOT, you will have to manually update B-1.0-SNAPSHOT -> A-1.0 before you can start releasing project B through Nexus.

  • Make sure the scm tag within the root pom.xml exactly matches the current SVN location of the pom.xml itself.

  • If you have a multi-project with nested modules, ensure they have either their own scm tag configured correctly too, or not defined at all.

  • RAT check your project sources required license headers using apache-rat-plugin (defined in the portals-pom) using: mvn install -P rat

Step 2: Publish a snapshot

  • first make sure to start with a clean/pristine checkout of the project, run at least mvn clean

  • If you followed the advise in the main doc for the previous step by running mvn release:prepare -DdryRun=true, make sure to run mvn release:clean first before continuing

  • mvn deploy

    • If you experience an error during deployment like a HTTP 401 check your settings for the required server entries as outlined in the Prerequisites.
  • verify the deployment under Maven Snapshot repository on Apache (Nexus: Repositories->Snapshots)

Step 3: Prepare the release

  • Make sure to start clean by running mvn release:clean clean

  • mvn release:prepare If you experience a BUILD FAILURE because of svn failing to commit with an error message like: svn: The specified baseline is not the latest baseline, so it may not be checked out.:

    • when using the SVN EU mirror it might occur when the SVN server sync hasn't been completed yet, causing the SVN EU mirror to be slightly out-of-sync temporarily
    • try running svn up and mvn release:prepare one or more times again, it usually completes successfully after one or more retry.

    • if it keeps failing, you can restart from scratch by running mvn release:rollback first, see also: http://maven.apache.org/plugins/maven-release-plugin

Step 4: Stage the release

  • mvn release:perform

    • This will create a new temporary Nexus staging repository and upload to it, or append to it if you are combining multiple release candidates together. This temporary staging repository, while still open (see next step) will only be visible and accessible by yourself until closed (next step). Once the staging repository is closed, you can no longer add more release candidates to it.

      See http://www.sonatype.com/books/nexus-book/reference/staging.html for further details.

Step 5: close the staging repository

Follow the instructions as described in the main doc once you've released all candidates you intended to, otherwise repeat the above steps for additional release candidates first.

Once the staging repository is closed, its repository path becomes public accessible, so you can use that as reference in the VOTE email to send out in the next steps.

Step 6 and later

Just follow the instructions as provided in the main doc

FrontPage/HowtoUseNexusForRelease (last edited 2010-04-09 14:18:41 by AteDouma)