Versions Compared

Key

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

...

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

Maven settings to release DSpace < 6

With DSpace 6 we changed the maven plugin that pushes our releases to Sonatype. The configuration above is correct beginning with DSpace 6. In case you release a previous DSpace version, you'll need to copy the server section two times and change the id to sonatype-nexus-snapshots and sonatype-nexus-staging. A settings file that allows you to release all versions of DSpace would look like the following example:

Code Block
<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>ossrh</id>
      <username>YourSonatypeUsername</username>
      <password>YourSonatypePassword</password>
    </server>
    <!--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>

While it may look surprisingly that you have to add the same credentials three times, DSpace < 6 will be looking for these server IDs and the upload to sonatype will fail as unauthorized if they are missing.

Using SSH and GPG agents

During a release you have to type the passwords of your GPG and SSH keys very often. Every DSpace module produces several files, all have to be signed and transfered to Sonatype. GPG and SSH agents help you to avoid typing passwords again and again. To use an ssh-agent just start it, export the required environment variables and add your ssh-key. To use a gpg agent start it, export the required environment variables and add the following to your ~/.m2/settings.xml:

Code Block
<settings>
...
  <profiles>  
    <profile>
      <id>gpg-profile</id>
      <properties>
        <gpg.useagent>true</gpg.useagent>
        <!-- If you have gpg2 instead, you can tell Maven to use it instead of 'gpg' by uncommenting the following -->
        <!--<gpg.executable>gpg2</gpg.executable>-->
      </properties>
    </profile>
  </profiles>
...
</settings>

On each maven run it may ask you once about your password which is a big improvement.

Java Version

For DSpace 7.x, you must use Java 11.

For DSpace 6.x, you can use Java 8.
For DSpace 5.x, you should be using Java 7 and running Maven with "-Dhttps.protocols=TLSv1.2" to avoid errors as described at https://stackoverflow.com/a/50924208/3750035

...

If you are using a recent version of Ubuntu, OpenJDK 7 is harder and harder to find. However, there are still some PPAs that have unmaintained copies (i.e. no security patches). This is good enough for installing on something like vagrant-dspace just do perform the release. Here's a PPA that has worked (as of July 2017):

Code Block
# Install the add-apt-repository command (if not available)
sudo apt install software-properties-common
# Add a PPA that has old 7 versions of OpenJDK
sudo add-apt-repository ppa:openjdk-r/ppa
sudo apt-get update
# Install OpenJDK 7
sudo apt-get install openjdk-7-jdk
# Switch which Java alternative is in use (and select OpenJDK 7)
# OBVIOUSLY, YOU SHOULD MAKE SURE TO SWITCH BACK AFTER THE RELEASE IS COMPLETE
update-alternatives --config java
# Check that the settings are now correct
java -version

Using SSH and GPG agents

During a release you have to type the passwords of your GPG and SSH keys very often. Every DSpace module produces several files, all have to be signed and transfered to Sonatype. GPG and SSH agents help you to avoid typing passwords again and again. To use an ssh-agent just start it, export the required environment variables and add your ssh-key. To use a gpg agent start it, export the required environment variables and add the following to your ~/.m2/settings.xml:

Code Block
<settings>
...
  <profiles>  
    <profile>
      <id>gpg-profile</id>
      <properties>
        <gpg.useagent>true</gpg.useagent>
        <!-- If you have gpg2 instead, you can tell Maven to use it instead of 'gpg' by uncommenting the following -->
        <!--<gpg.executable>gpg2</gpg.executable>-->
      </properties>
    </profile>
  </profiles>
...
</settings>

On each maven run it may ask you once about your password which is a big improvement.

Java Version

For DSpace 7.x, you must use Java 11.


Use Maven 3 or above

Use Maven 3 or above

...

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

For DSpace 7.x, you must use Maven 3.3 or above.  However, Maven 3.5.4 or above is highly recommended, as it.  It's necessary to regenerate the LICENSES_THIRD_PARTY file (see notes below)

...