Skip to content

How to create releases with Maven

dstenger edited this page Jul 31, 2019 · 6 revisions

This manual applies to all CITE projects using Maven.

How to configure Maven

Configure Maven release plugin

Following is a recommended Maven release plugin configuration for all projects:


Create signed artefacts

Add maven-gpg-plugin to pom.xml of project to be deployed:

                  <!-- Enable if GPG 2.1+ is used -->

Deploy artefacts to staging repository

Add staging repository to pom.xml of project to be deployed:


Configure Maven scm publish plugin

Following is a recommended Maven configuration for all projects:


[SCM_URL] has to be replaced with the URL of the project repository (e.g.

How to create Jenkinsfile

Create Jenkinsfile with path jenkinsfiles/release/Jenkinsfile and add following content.

pipeline {
  agent any
  tools {
    maven 'mvn'
    jdk 'JDK 8'
  stages {
    stage('Preparation') {
        sh 'git clone[TEST_SUITE_ID].git .'
    stage('Release') {
        sh 'mvn --version'
        sh 'mvn -Dresume=false -DdryRun=true release:prepare -Psign-artifacts-with-ogc,integration-tests,docker -DreleaseVersion=${releaseVersion} -DdevelopmentVersion=${developmentVersion}'
        sh 'mvn -Dresume=false release:prepare release:perform -Psign-artifacts-with-ogc,integration-tests,docker -DreleaseVersion=${releaseVersion} -DdevelopmentVersion=${developmentVersion}'
    stage('Publication of site') {
        sh 'mvn --version'
        sh 'git checkout ${releaseVersion}'
        sh 'mvn clean install site site:stage scm-publish:publish-scm'
    stage('Results') {
        archive 'target/*'

Caution: All place holders ([...]) must be replaced.

Now, releases can be created with any Jenkins instance by using the Jenkinsfile.

How to execute Maven plugins manually

Create release with Maven release plugin

Execute followings commands to create a release:

mvn -Dresume=false -DdryRun=true release:prepare
mvn -Dresume=false release:prepare release:perform -Psign-artifacts-with-ogc

Publish sites with Maven scm publish plugin

Execute following commands to publish sites:

mvn clean install site site:stage scm-publish:publish-scm

If a release shall be deployed, check out the tag of the release first.

You can’t perform that action at this time.