Step by step of how to perform a Release via Maven |
This document is intended to be kept up to date by the DSpace Release Managers. It details the steps necessary to perform snapshot and official releases of DSpace and supporting Modules. |
Table of Contents |
For lack of a better place at this time, here's some useful pages on Sonatype which detail the Sonatype Maven Release Process: |
As of 2012 (DSpace 3.0), DSpace has moved to a new release numbering scheme/format. Release numbers will now only consist of two numbers.
Release Numbering Scheme: [major].[minor]
(e.g. 3.0, 3.1, 3.2, 4.0)
For more information see DSpace Release Numbering Scheme and the initial DSpace 3.0 Announcement
The one exception is that the Language Packs ( |
To perform a release, you must have all of the following:
hkp://pgp.mit.edu
, as this is the Key Server Sonatype uses for verification:gpg --keyserver hkp://pgp.mit.edu --send-keys [yourKeyID]
[yourKeyId] can be found by running the following command and copying the alpha-numeric string after the "/" on the "pub" line
DSpace's root pom.xml already has the correct staging and snapshot repositories listed in the OSS parent's '<distributionManagement>' section. In order to deploy, you will need to add your Sonatype OSS username and password to your local ~/.m2/settings.xml
file:
<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> <!--Login info for Sonatype SnapShot repository--> <server> <id>sonatype-nexus-snapshots</id> <username>YourSonatypeUsername</username> <password>YourSonatypePassword</password> </server> <!--Login info for Sonatype Staging/Release repository--> <server> <id>sonatype-nexus-staging</id> <username>YourSonatypeUsername</username> <password>YourSonatypePassword</password> </server> </servers> </settings> |
If you don't yet have a ~/.m2/settings.xml
file, you should create one, and copy the full contents above (obviously make sure to put in your username and password).
Make sure you're using a recent version of Maven. As of this writing, both Maven 2.2.1 and Maven 3 were known to work.
In particular, avoid using either Maven 2.1.0 or 2.2.0 as both have know issues with the Sonatype Release Process. Maven 2.2.0 has a serious bug that affects deployments: MNG-4235. Maven 2.1.0 also is problematic, as it produces improper GPG signatures.
For more information see the Prerequisites section of the Sonatype Maven Repository Usage Guide
From a clean, up-to-date copy of master/branch, run the following command:
mvn clean javadoc:jar source:jar deploy
You will have to enter in your GPG passphrase (which you established when you created your Code Signing Key).
The snapshot will be immediately available in the public Sonatype repository: http://oss.sonatype.org/content/groups/public
These same steps are also covered in the Sonatype Maven Repository Usage Guide |
If possible, you should release the DSpace Language Packs (i18n modules) before the main release. Oftentimes, it's best to release these one or two days prior to the DSpace release (that way they've already propagated out to the Maven repository).
At the moment the i18n modules are maintained in two separate GitHub projects. There are currently two i18n modules you will need to release:
Note that the version numbering convention for Language Packs is always the same as the current DSpace release, with an additional |
For each module, perform the full release steps that follow. To save space, the steps are only listed for one of the modules (but don't forget to run it for both language packs): WARNING: INSTRUCTIONS NEED UPDATE FOR GITHUB!
svn co
https://scm.dspace.org/svn/repo/modules/dspace-api-lang/trunk
dspace-api-lang
mvn release:prepare -DdryRun=true
mvn release:prepare -Dresume=false
[major].[minor].[sequence-number]
(e.g. 3.0.0, 3.0.1, etc for 3.0 releases of language packs)mvn release:perform
Once the Language Packs are released, you may need to modify the DSpace root pom.xml (https://github.com/DSpace/DSpace/blob/master/pom.xml) to reference the new version of the Language Packs. This should be similar to the following:
If possible, you'd only want to commit this after the i18n modules are available in the Maven Repository. But, if you are in a rush, you can commit this change earlier (though be warned that this will break the build process for anyone who hasn't manually installed the i18n modules to his/her local ~/.m2/
directory).
In the main pom.xml, provide the proper version range for each language pack. In the below example, we are saying to use any language pack version which is at least version 3.0.0, but is less than version 4.0.0:
<!-- DSpace Localization Packages --> <dependency> <groupId>org.dspace</groupId> <artifactId>dspace-api-lang</artifactId> <version>[3.0.0,4.0.0)</version> </dependency> <dependency> <groupId>org.dspace</groupId> <artifactId>dspace-xmlui-lang</artifactId> <version>[3.0.0,4.0.0)</version> <type>war</type> </dependency> |
Hopefully, you've already been talking with others about getting Documentation updated!
You should also double check that the following "main pages" are updated in the Documentation:
jiraissue
plugin. In the url
argument for that plugin, you should find the DSpace version number embedded in the querystring like: "... AND+fixVersion+%3D+%221.7.0%22 ..." If you look closely, you'll see the 'fixVersion' is set to "1.7.0" in that search string. All you should need to do is update that version number!Also make sure to update the title
argument for that jiraissue
plugin to list the proper version number information
Obviously, this is just a brief reminder of important areas of Documentation which always require updates. There's surely other areas, like Configuration section, which will require some updates for your release. |
Make sure the latest Wiki-based Documentation has been exported as PDF and committed to [dspace-src]/dspace/docs/ in GitHub.
See this DSpace documentation management guide: How To Export Downloadable Docs from Wiki |
Make sure that the contents of all README, LICENSE, LICENSES_THIRD_PARTY, NOTICE files are up-to-date in GitHub. These files reside in [dspace-src]. If anything is out-of-date, make sure to update it and commit the proper changes before continuing.
Pay close attention to the "LICENSES_THIRD_PARTY" file. You should attempt to determine if any third-party dependencies were added or removed and update their licensing information in this file. Information on the Maven commands that may come in handy when updating this file can be found in the Notes at the end of the "LICENSES_THIRD_PARTY" file.
Checkout a copy of the to-be-release version either from a branch or master. For example:
git clone git@github.com:DSpace/DSpace.git ~/dspace-release git checkout master |
This step is not required, but performs a useful sanity check without committing any changes. From your clean, up-to-date copy of master/branch, run the following command (from [dspace-src]
):
mvn release:prepare -DdryRun=true |
You will have to enter in your GPG passphrase (which you established when you created your Code Signing Key).
If you notice an issue or an error occurs, you can re-run the Dry Run using the following command:
|
This step will set the version declared in the project's pom.xml files, commit the changes to master/branch, tag the release, and finally, check in the master/branch change that increments the next development version (e.g. x.y-SNAPSHOT) in the pom.xml files.
mvn release:prepare -Dresume=false |
(Optionally, you may also include the parameters -Dusername=YourGitHubUsername -Dpassword=YourGitHubPassword
at the end of the above command, though I've not found these to be necessary)
The above command will ask you three basic questions. Here are sample answers for DSpace 3.0:
"What is the release version for: XXX" : 3.0
"What is SCM release tag or label for: XXXX" : dspace-3.0
"What is the new development version for: XXXX" : 3.1-SNAPSHOT
|
You will also have to enter in your GPG passphrase (which you established when you created your Code Signing Key).
The
|
If backing out of this step is needed for any reason, the following will restore the github repository and your working copy to the state it was previously in:
|
This step will sign, checksum, and push all release artifacts (including javadocs and sources) to the Sonatype staging repository (http://oss.sonatype.org/). Run the following:
mvn release:perform |
You should be prompted by Maven to specify your GPG passphrase (which you established when you created your Code Signing Key). If you run into any issues, it's possible to specify your GPG key and passphrase as arguments to the above command (e.g. -Darguments="-Dgpg.keyname=YourKeyId -Dgpg.passphrase=YourKeyPassword"
)
If any errors or problems occur during the deploy, you can re-run |
For screenshots and more details on this step, visit the Sonatype Repository Usage Guide's section on Releasing your artifacts |
Download and test that the artifacts in staging are exactly as they should be once deployed to central.
If anything is incorrect, select the staged repository and select "Drop". After the problem is resolved, you can re-deploy the artifacts to staging and verify them again. To re-deploy an already-tagged release: |
If everything looks good, select the repository and select "Release". The artifacts should be synced to Maven central (http://repo2.maven.org/maven2/org/dspace/) within an hour.
Once you select "Release", there is no way to "undo" the release. If any major issues are found, you'll have to increment the version number and perform a new bug-fix release. |
The previous actions will have checked out the release tag into the target directory under [dspace-src]/target/checkout
. Navigate to that directory and execute the creation of the distributions using the following command. This will create two zip, bzip and gzipped files in the target directory. One set of files is the "binary" release, and the other set is the source release.
(Note: If you've already removed the target/checkout
directory, you can also checkout a fresh copy of the newly tagged version and run this command from the DSpace parent directory.)
localhost$ cd target/checkout localhost$ mvn package -Pdistributions [INFO] Scanning for projects... [INFO] ---------------------------------------------------------------------------- [INFO] Building DSpace Parent Project [INFO] task-segment: [package] [INFO] ---------------------------------------------------------------------------- [INFO] [site:attach-descriptor] [INFO] [assembly:single -(execution. default-)] [INFO] Building zip: .../target/dspace-1.8.0-release.zip [INFO] Building tar: .../target/dspace-1.8.0-release.tar.gz [INFO] Building tar: .../target/dspace-1.8.0-release.tar.bz2 [INFO] Building zip: .../target/dspace-1.8.0-src-release.zip [INFO] Building tar: .../target/dspace-1.8.0-src-release.tar.gz [INFO] Building tar: .../target/dspace-1.8.0-src-release.tar.bz2 [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESSFUL [INFO] ------------------------------------------------------------------------ |
Upload both the source and binary releases to Sourceforge.net. You can either upload them via the web interface, or copy them over via scp
or other command line tools. If you want to copy the files from command line, follow the directions found here: http://apps.sourceforge.net/trac/sourceforge/wiki/File%20management%20service
Using scp
to copy to the "DSpace Stable" file directory: (example for 1.8.0 final)
(NOTE: You will need to first create the 'DSpace Stable/1.8.0' directory via SourceForge's Admin UI)
scp <files> <username>,dspace@frs.sourceforge.net:"/home/frs/project/d/ds/dspace/DSpace\\ Stable/1.8.0/" |
Using scp
to copy to the "DSpace Release Candidate" file directory: (example for 1.8.0-rc2)
(NOTE: You will need to first create the 'DSpace Release Candidate/1.8.0-rc2' directory via SourceForge's Admin UI)
scp <files> <username>,dspace@frs.sourceforge.net:"/home/frs/project/d/ds/dspace/DSpace\\ Release\\ Candidate/1.8.0-rc2/" |
You must wait for all the packages to be available at http://repo2.maven.org/maven2/org/dspace/ before you announce the release. Until the DSpace packages are available in the Maven repository, no one else will be able to build DSpace using Maven. |
To manually create a branch, run a command similar to:
svn copy http://scm.dspace.org/svn/repo/dspace/trunk \ http://scm.dspace.org/svn/repo/dspace/branches/dspace-3_x \ -m "Creating a branch for 3.x bug-fix releases." |
Then, go back to your Trunk checkout, and make sure to update its version numbers in the pom.xml files by running the following:
mvn release:update-versions |
(Remember to enter in the next appropriate majorversion number. E.g. After releasing 3.0, Trunk should be updated to "4.0-SNAPSHOT", while the new 3_x branch should be at "3.1-SNAPSHOT")
update-versions
command doesn't always work perfectly. You will want to try a complete rebuild of DSpace before committing anything, as it sometimes misses updating a few version numbers.<scm>
section is appropriate in the pom.xml files of your new Branch. Remember, the <scm>
configurations should point at the branch, rather than back at Trunk.If you encounter one of these errors when building/packaging DSpace:
FATAL ERROR: "Reason: Could not find the model file '../dspace-xmlui-lang'. for project unknown"
OR
FATAL ERROR: "Reason: Could not find the model file '../dspace-api-lang'. for project unknown"
This is a known bug in Maven. The problem is that you likely have a 'dspace-xmlui-lang' or 'dspace-api-lang' folder at the same level as your [dspace-source] parent folder. Essentially, Maven located them and tried to add them into the build process (which it shouldn't have). The fix is to completely delete the 'dspace-xmlui-lang' and 'dspace-api-lang' folders, and try to rebuild DSpace.