Skip to content

Doing a GeoNetwork release

This section documents the steps followed by the development team to do a new release.

Once the release branch has been thoroughly tested and is stable a release can be made.

The following script can be used on Linux and Mac. For this a running build environment is needed with the following utilities: sed, xmlstarlet and sftp.

  1. Prepare the release (examples prepairs version 4.2.1 as latest release):

    # Setup properties
    # Get the branch
    git clone --recursive \
    cd geonetwork-$versionbranch
    # Create or move to the branch for the version
    # Create it if it does not exist yet
    git checkout -b $versionbranch $frombranch
    # or move into it if it exist
    # git checkout $versionbranch
    # or stay in main branch if the release is on main
    # Update version number (in pom.xml, installer config and SQL)
    ./ $currentversion $newversion
    # Generate list of changes
    cat <<EOF > docs/changes/changes$newversion.txt
    === GeoNetwork $version: List of changes
    git log --pretty='format:- %s' $previousversion... >> docs/changes/changes$newversion.txt
  2. Prepare change-log notes.

    Git notes are managed similar to push and pulling tags. Start by pulling the latest notes:

    git pull origin refs/notes/commits 

    Review changes along with any notes:

    git log --pretty='format:%h: %s %n      note: %N' $previousversion...

    Use git note append to document commits adding major features.

    git notes append <sha> -m "<description of major feature>"

    Use git note remove if you need to clear a note and start again:

    git notes remove <sha>

    Preview changes using:

     git log --pretty='format:* %N' $previousversion... | grep -v "^* $"

    Save your notes:

    git push origin refs/notes/commits

  3. Create change log page: docs/manual/docs/overview/change-log/

    cat <<EOF > docs/manual/docs/overview/change-log/version-$
    # Version $version
    GeoNetwork $version is a minor release.
    ## Migration notes
    ### API changes
    ### Installation changes
    ### Index changes
    ## List of changes
    Major changes:
    git log --pretty='format:* %N' $previousversion... | grep -v "^* $" >> docs/manual/docs/overview/change-log/version-$
    cat <<EOF > docs/manual/docs/overview/change-log/version-$
    and more \... see [$version issues]($version+is%3Aclosed) and [pull requests]($version+is%3Aclosed) for full details.

    Fill in the above markdown file, removing any unused headings.

  4. Update links and navigation:

    • docs/manual/mkdocs.yml
    • docs/manual/docs/overview/change-log/
    • docs/manual/docs/overview/change-log/
    • docs/manual/docs/overview/change-log/
    • docs/manual/docs/overview/change-log/

    Test documentation locally:

    cd docs/manual
    mkdocs serve
    Once running check the new page:
    open http://localhost:8000/ocverview/change-log/$newversion

  5. Commit & tag the new version

    # Then commit the new version
    git add .
    git commit -m "Update version to $newversion"
    # Create the release tag
    git tag -a $version -m "Tag for $version release"
  6. Build

    # deep clean
    mvn clean:clean@reset
    # Build the new release
    mvn install -Drelease
    # Create a minimal war
    cd web
    mvn clean install -DskipTests -Pwar -Pwro4j-prebuild-cache
    # Download Jetty and create the installer
    cd ../release
    mvn clean install -Pjetty-download,bundle
    # Deploy to osgeo repository (requires credentials in ~/.m2/settings.xml)
    cd ..
    mvn deploy -Drelease
  7. Test

    cd target/GeoNetwork-$version
    unzip geonetwork-bundle-$ -d geonetwork-bundle-$newversion
    cd geonetwork-bundle-$newversion/bin
    ./ -f
  8. Set the next version

    # Set version number to SNAPSHOT
    ./ $newversion $nextversion
    # Add SQL migration step for the next version
    mkdir web/src/main/webapp/WEB-INF/classes/setup/sql/migrate/v${nextversionnosnapshot//[.]/}
    cat <<EOF > web/src/main/webapp/WEB-INF/classes/setup/sql/migrate/v${nextversionnosnapshot//[.]/}/migrate-default.sql
    UPDATE Settings SET value='${nextversionnosnapshot}' WHERE name='system/platform/version';
    UPDATE Settings SET value='SNAPSHOT' WHERE name='system/platform/subVersion';
    vi web/src/main/webResources/WEB-INF/config-db/database_migration.xml

    In WEB-INF/config-db/database_migration.xml add an entry for the new version in the 2 steps:

    <entry key="4.2.2">
    git add .
    git commit -m "Update version to $nextversion"
  9. Publishing

    # Push the branch and tag
    git push origin $versionbranch
    git push origin $version
  10. Generate checksum files

    • If using Linux:

      cd web/target && md5sum geonetwork.war > geonetwork.war.md5 && cd ../..
      cd release/target/GeoNetwork-$version && md5sum geonetwork-bundle-$ >  geonetwork-bundle-$ && cd ../../..
    • If using Mac OS X:

      md5 -r web/target/geonetwork.war > web/target/geonetwork.war.md5
      md5 -r release/target/GeoNetwork-$version/geonetwork-bundle-$ > release/target/GeoNetwork-$version/geonetwork-bundle-$

    On sourceforge first:

    sftp $sourceforge_username,
    # For stable release
    cd /home/frs/project/g/ge/geonetwork/GeoNetwork_opensource
    # or for RC release
    cd /home/frs/project/g/ge/geonetwork/GeoNetwork_unstable_development_versions/
    mkdir v4.2.1
    cd v4.2.1
    put docs/changes/changes4.2.1-0.txt
    put release/target/GeoNetwork*/geonetwork-bundle*.zip*
    put web/target/geonetwork.war*
  11. Close the milestone on github with link to sourceforge download.

    Publish the release on github .

    Update the website links .

    Send an email to the mailing lists.

  12. Merge in depending branches

    If a major version, then master version has to be updated to the next one (eg. if 3.8.0, then 3.7.x is 3.9.x).

    # Create it if it does not exist yet
    git checkout master
    ./ $currentversion $nextMajorVersion

    Update documentation to reflect series change of latest, stable, maintenance and archive:

    • docs/manual/mkdocs.yml navigation changes as branches change role
    • docs/manual/docs/overview/change-log/
    • docs/manual/docs/overview/change-log/
    • docs/manual/docs/overview/change-log/
    • docs/manual/docs/overview/change-log/

    Commit the new version

    git add .
    git commit -m "Update version to $nextMajorVersion"
    git push origin master