Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Make sure you're using a recent version of Maven. As of this writing, Maven 3.0.3 or 3.0.4 5 is known to work.

For more information see the Prerequisites section of the Sonatype Maven Repository Usage Guide

...

Double Check Language Packs' Version Ranges

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).

Info

NOTE: if you're skimming these instructions, you may be tempted to think you've already handled this step, because you have already released new language packs, as detailed above. If you think so, you probably have NOT yet completed the steps below. The steps below tell DSpace what version of language packs to use. The language packs you've released following the steps above won't ever get used if you don't do the steps below. This is an easy thing to miss. Don't. Just check, to be sure.

 

Once the Language Packs are released, you will probably 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, 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:

...

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.LICENSES_THIRD_PARTY" file.

Warning: optional profiles need to be specified at compile time

Just including a little warning about this up front. The following optional modules need to be specified with every mvn command below. We will make an effort to keep this list up to date, but you should verify it before you cut a new release. Things change. Forgetting an optional module means you'll have to cut another release.

Code Block
mvn {target} {-option} -Dmirage2.on=true -P dspace-lni

 

Checkout Master or Branch to Release

...

Before starting the release, you may wish to ensure your local maven cache (~/.m2/repository) is completely up-to-date by running (from [dspace-src]):

Code Block
mvn install -Dmirage2.on=true -P dspace-lni

Updating your local maven cache will help to ensure that the release process goes more smoothly, and should help you to avoid any errors having to do with Maven being unable to locate any particular dependencies. That being said, this step actually may not be necessary, if our release process is working correctly.

...

Code Block
mvn release:prepare -DdryRun=true -Dmirage2.on=true -P dspace-lni

You will have to enter in your GPG passphrase (which you established when you created your Code Signing Key).

Info
If you need to re-run the Dry Run
If you need to re-run the Dry Run

If you notice an issue or an error occurs, you can re-run the Dry Run using the following command:

  • mvn release:prepare -DdryRun=true -Dresume=false -Dmirage2.on=true -P dspace-lni

You can also clean up any of the release files that the Dry Run created, and just re-run it.

  • mvn release:clean
  • mvn release:prepare -DdryRun=true -Dmirage2.on=true -P dspace-lni

Tag and Increment Version

...

Code Block
mvn release:prepare -Dresume=false -Dresume=false-Dmirage2.on=true -P dspace-lni

(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)

...

Info
titleMany JavaDoc WARNING messages will scroll by

As the release process scrolls by, you likely will see a LOT of "WARNING" messages.  Don't worry, these should be just Javadocs warnings, and can be safely ignored.  Just be patient, and see if it all succeeds in the end. We know it's nerve-wracking, but it will all be OK.

What do successful tagging results look like?

...

Note
titleIf you receive a project dependency error

The mvn release:prepare command may fail to compile part way through the process, complaining that an internal project dependency is not met. If this occurs, don't worry. You just may need to ensure those dependencies get installed to your local cache.  To fix this, you should be able to run the following:

  1. mvn release:clean   (clean out any files created by the previous "mvn release:prepare")
  2. mvn install -Dmirage2.on=true -P dspace-lni
  3. mvn release:prepare -Dmirage2.on=true -P dspace-lni
Note
titleBacking out of changes

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:

  1. mvn release:rollback
    • Warning: running a "mvn release:rollback" will perform an immediate, automatic push to GitHub master, rolling back any previously committed POM version changes.
    • If you want to avoid the immediate, automatic push to GitHub master, you may be able to use "mvn release:clean" to just clean up the locally made release preparations.
  2. Now delete the tag in GitHub (local & remote)
    • git tag -d dspace-x.y
    • git push origin :refs/tags/dspace-x.y

...

Code Block
mvn release:perform -Dmirage2.on=true -P dspace-lni

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")

Info
titleIf you need to re-deploy

If any errors or problems occur during the deploy, you can re-run mvn release:perform -Dmirage2.on=true -P dspace-lni safely after fixing those issues (re-running it will just overwrite existing staged contents).

...

  1. Login to http://oss.sonatype.org/
  2. Click "Staging Repositories" in the left column, then select the checkbox next to the staged repository on the right. The contents of it will open up at the bottom of the page.
  3. With the staged repository still selected, click the "Close" button at the top.
  4. Download and test that the artifacts in staging are exactly as they should be once deployed to central.

    Info
    titleIf You Need to Revert Back before Releasing

    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:
    mvn release:perform -Dmirage2.on=true -P dspace-lni -Dtag=dspace-x.y -DconnectionUrl=scm:git:git@github.com:DSpace/DSpace.git -Darguments="-Dgpg.keyname=YourKeyId -Dgpg.passphrase=YourKeyPassword"

  5. 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 2 hours.

    Warning
    titleOnce Released, There is No "Undo" Option

    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.

...

Code Block
localhost$ cd target/checkout/dspace/
localhost$ mvn package -Pdistributions -Dmirage2.on=true -P dspace-lni
 [INFO] Scanning for projects...
 [INFO]
 [INFO] ----------------------------------------------------------------------------
 [INFO] Building DSpace Assembly and Configuration 3.0
 [INFO] ----------------------------------------------------------------------------
 ....
 [INFO] --- maven-assembly-plugin:2.2.1:single (default) @ dspace ---
 [INFO] Reading assembly descriptor: src/main/assembly/release.xml
 [INFO] Reading assembly descriptor: src/main/assembly/src-release.xml
 [INFO] Building zip: [full-path-to-dspace-src]/dspace/target/dspace-3.0-release.zip
 [INFO] Building tar: [full-path-to-dspace-src]/dspace/target/dspace-3.0-release.tar.gz
 [INFO] Building tar: [full-path-to-dspace-src]/dspace/target/dspace-3.0-release.tar.bz2
 [INFO] Building zip: [full-path-to-dspace-src]/dspace/target/dspace-3.0-src-release.zip
 [INFO] Building tar: [full-path-to-dspace-src]/dspace/target/dspace-3.0-src-release.tar.gz
 [INFO] Building tar: [full-path-to-dspace-src]/dspace/target/dspace-3.0-src-release.tar.bz2
 [INFO] ------------------------------------------------------------------------
 [INFO] BUILD SUCCESS
 [INFO] ------------------------------------------------------------------------

...