Here is the scripts to deploy the artifacts and
                  also the nexus staging job.    
                
                #!/bin/bash -ex
                  
                  TOOLS_PREFIX='/opt/tools'
                  JAVA_PREFIX="${TOOLS_PREFIX}/java/oracle"
                  MVN_HOME="${TOOLS_PREFIX}/apache-maven/latest"
                  JAVA_HOME="${JAVA_PREFIX}/jdk-8/latest"
PATH="${MVN_HOME}/bin:${JAVA_HOME}/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
                  
                  # Maven plugins
VERSIONS_PLUGIN='org.codehaus.mojo:versions-maven-plugin:2.7'
HELP_PLUGIN='org.apache.maven.plugins:maven-help-plugin:3.1.0'
                  
                  # Check whether top level pom.xml contains SNAPSHOT
                  version
                  if ! grep '<version>' pom.xml | grep 'SNAPSHOT'
                  ; then
                    echo '-[ Missing SNAPSHOT version in POM!
                  ]-------------------------------------------'
                    exit 1
                  fi
                  
                  # Compute release versions
                  SNAPSHOT_VERSION=`mvn -B ${HELP_PLUGIN}:evaluate
                  -Dexpression=project.version 2> /dev/null | grep -E
                  '^[0-9]+(\.[0-9]+)+-SNAPSHOT$'`
                  
                  if [ -z "${RELEASE_VERSION}" ]; then
                    if [ -z ${SNAPSHOT_VERSION} ]; then
                      echo '-[ Missing required snapshot version number!
                  ]----------------------------------'
                    fi
                    RELEASE_VERSION=`echo ${SNAPSHOT_VERSION} | sed -e
                  's/-SNAPSHOT//'`
                  fi
                  
                  # Bash specific code
                  if [ -z "${NEXT_VERSION}" ]; then
                    NEXT_VERSION=`echo ${RELEASE_VERSION} | sed -e
                  's/\([0-9][0-9]*\.[0-9][0-9]*\).*/\1/'`
                    set -f
                    NEXT_COMPONENTS=(${RELEASE_VERSION//\./ })
                    LAST_INDEX=$((${#NEXT_COMPONENTS[@]} - 1))
                   
                  NEXT_COMPONENTS[${LAST_INDEX}]=$((${NEXT_COMPONENTS[${LAST_INDEX}]}
                  + 1))
                    NEXT_VERSION=`echo ${NEXT_COMPONENTS[@]} | tr ' '
                  '.'`'-SNAPSHOT'
                  fi
                  
                  RELEASE_TAG="${RELEASE_VERSION}"
                  RELEASE_BRANCH="${RELEASE_VERSION}"-BRANCH
                  
                  echo "Current version: ${SNAPSHOT_VERSION}"
                  echo "Release version: ${RELEASE_VERSION}"
                  echo "Next version:    ${NEXT_VERSION}"
                  echo "Release tag:     ${RELEASE_TAG}"
                  
                  if [ -z "${SNAPSHOT_VERSION}" -o -z
                  "${RELEASE_VERSION}" -o -z "${NEXT_VERSION}" ]; then
                    echo '-[ Missing required version numbers!
                  ]------------------------------------------'
                    exit 1
                  fi
                  
                  if [ ${DRY_RUN} = 'true' ]; then
                    echo '-[ Dry run turned on
                  ]----------------------------------------------------------'
                    MVN_DEPLOY_ARGS=''
                    echo '-[ Skipping GitHub branch and tag checks
                  ]--------------------------------------'
                  else
                    MVN_DEPLOY_ARGS='deploy:deploy'
                    GIT_ORIGIN=`git remote`
                    echo '-[ Prepare branch
                  ]-------------------------------------------------------------'
                    if [[ -n `git branch -r | grep
                  "${GIT_ORIGIN}/${RELEASE_BRANCH}"` ]]; then
                      if [ "${OVERWRITE}" = 'true' ]; then
                        echo "${GIT_ORIGIN}/${RELEASE_BRANCH} branch
                  already exists, deleting"
                        git push --delete origin "${RELEASE_BRANCH}"
                  && true
                      else
                        echo "Error: ${GIT_ORIGIN}/${RELEASE_BRANCH}
                  branch already exists"
                        exit 1
                      fi
                    fi
                    echo '-[ Release tag cleanup
                  ]--------------------------------------------------------'
                    if [[ -n `git ls-remote --tags ${GIT_ORIGIN} | grep
                  "${RELEASE_TAG}"` ]]; then
                      if [ "${OVERWRITE}" = 'true' ]; then
                        echo "${RELEASE_TAG} tag already exists,
                  deleting"
                        git push --delete origin "${RELEASE_TAG}"
                  && true
                      else
                        echo "Error: ${RELEASE_TAG} tag already exists"
                        exit 1
                      fi
                    fi
                  fi
                  
                  # Always delete local branch if exists
                  git branch --delete "${RELEASE_BRANCH}" &&
                  true
                  git checkout -b ${RELEASE_BRANCH}
                  # Always delete local tag if exists
                  git tag --delete "${RELEASE_TAG}" && true
                  
                  # Setup jakartaee-stable-bot account information
                  git config --global user.email "
jakartaee-stable-bot@xxxxxxxxxxx"
                  git config --global 
user.name
                  "Eclipse jakartaee-stable Bot"
                  # Workaround: GPG initialization
                  gpg --batch --import ${KEYRING}
                  for fpr in $(gpg --list-keys --with-colons  | awk -F:
                  '/fpr:/ {print $10}' | sort -u);
                  do
                    echo -e "5\ny\n" |  gpg --batch --command-fd 0
                  --expert --edit-key $fpr trust;
                  done
                  
                  # Project identifiers
                  ARTIFACT_ID=$(mvn -B ${HELP_PLUGIN}:evaluate
                  -Dexpression=project.artifactId | grep -Ev '(^\[)')
                  GROUP_ID=$(mvn -B ${HELP_PLUGIN}:evaluate
                  -Dexpression=project.groupId | grep -Ev '(^\[)')
                  
                  echo '-[ Set release version
                  ]--------------------------------------------------------'
                  # Set release version
                  mvn -U -C -B \
                      -DnewVersion="${RELEASE_VERSION}" \
                      -DgenerateBackupPoms=false \
                      clean ${VERSIONS_PLUGIN}:set
                  
                  echo '-[ Commit modified pom.xml files
                  ]----------------------------------------------'
                  POM_FILES=`git status | grep -E 'modified:.*pom\.xml'
                  | sed -e
                  's/[[:space:]][[:space:]]*modified:[[:space:]][[:space:]]*//'`
                  git add ${POM_FILES} && \
                  git commit -m "Prepare release
                  ${GROUP_ID}:${ARTIFACT_ID}:${RELEASE_VERSION}"
                  
                  ##### Temporary workaround begin
#NEXUS_PLUGIN='org.sonatype.plugins:nexus-staging-maven-plugin:1.6.7'
                  #NEXUS_PLUGIN_PARAMS='-DnexusUrl=
https://oss.sonatype.org/
                  -DserverId=ossrh'
                  #STAGING_PROFILE_ID='7edbe315063867'
                  #STAGING_DESC="jakartaxmlrpc-${BUILD_ID}"
                  ## Open a new staging repo
                  #mvn -B ${NEXUS_PLUGIN_PARAMS} ${NEXUS_PLUGIN}:rc-open
                  \
                  #    -DstagingProfileId="${STAGING_PROFILE_ID}" \
                  #    -DstagingDescription="${STAGING_DESC}"
                  ## Get the ID of the newly created staging repo
                  #STAGING_REPO_ID=$(mvn -B ${NEXUS_PLUGIN_PARAMS}
                  ${NEXUS_PLUGIN}:rc-list | \
                  #    egrep "^\[INFO\] .*\-[0-9]+[ ]+OPEN[
                  ]+.*${STAGING_DESC}" | \
                  #    awk '{print $2}' | head -1)
                  #echo "STAGING_REPO_ID=${STAGING_REPO_ID}"
                  ##### Temporary workaround end
                  
                  echo '-[ Deploy artifacts to staging repository
                  ]-------------------------------------'
                  #    -DstagingRepositoryId="${STAGING_REPO_ID}" \
                  mvn -U -C -B \
                      -DskipTests -DadditionalJOption=-Xdoclint:none
                  -Poss-release -Pstaging \
                      clean package source:jar javadoc:jar gpg:sign
                  install:install ${MVN_DEPLOY_ARGS}
                  
                  echo '-[ Tag release
                  ]----------------------------------------------------------------'
                  git tag "${RELEASE_TAG}" -m "Release
                  ${GROUP_ID}:${ARTIFACT_ID}:${RELEASE_VERSION}"
                  
                  echo '-[ Set next snapshot version
                  ]--------------------------------------------------'
                  mvn -U -C -B \
                      -DnewVersion="${NEXT_VERSION}" \
                      -DgenerateBackupPoms=false \
                      clean ${VERSIONS_PLUGIN}:set
                  
                  echo '-[ Commit modified pom.xml files
                  ]----------------------------------------------'
                  POM_FILES=`git status | grep -E 'modified:.*pom\.xml'
                  | sed -e
                  's/[[:space:]][[:space:]]*modified:[[:space:]][[:space:]]*//'`
                  git add ${POM_FILES} && \
                  git commit -m "Prepare next development cycle for
                  ${NEXT_VERSION}"
                  
                  if [ ${DRY_RUN} = 'true' ]; then
                    echo '-[ Skipping GitHub update
                  ]-----------------------------------------------------'
                  else
                    echo '-[ Push branch and tag to GitHub
                  ]----------------------------------------------'
                    git push origin "${RELEASE_BRANCH}"
                    git push origin "${RELEASE_TAG}"
                  fi
                  
                
#!/bin/bash -ex
                  
                  TOOLS_PREFIX='/opt/tools'
                  JAVA_PREFIX="${TOOLS_PREFIX}/java/oracle"
                  MVN_HOME="${TOOLS_PREFIX}/apache-maven/latest"
                  JAVA_HOME="${JAVA_PREFIX}/jdk-8/latest"
PATH="${MVN_HOME}/bin:${JAVA_HOME}/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
                  
                  # Maven plugins
HELP_PLUGIN='org.apache.maven.plugins:maven-help-plugin:3.1.0'
NEXUS_PLUGIN='org.sonatype.plugins:nexus-staging-maven-plugin:1.6.7'
                  NEXUS_PLUGIN_PARAMS='-DnexusUrl=
https://oss.sonatype.org/
                  -DserverId=ossrh'
                  
                  case "${PROJECT}" in
                  
                    'Enterprise-Deployment')
                      GIT_REPO='
git@xxxxxxxxxx:eclipse-ee4j/enterprise-deployment.git'
                      STAGING_NAME='jakartaenterprisedeploy'
                    ;;
                  
                    'JAX-RPC-API')
                      GIT_REPO='
git@xxxxxxxxxx:eclipse-ee4j/jax-rpc-api.git'
                      STAGING_NAME='jakartaxmlrpc'
                    ;;
                  
                    'JAXR-API')
                      GIT_REPO='
git@xxxxxxxxxx:eclipse-ee4j/jaxr-api.git'
                      STAGING_NAME='jakartaxmlregistry'
                    ;;
                  
                    'Management-API')
                      GIT_REPO='
git@xxxxxxxxxx:eclipse-ee4j/management-api.git'
                      STAGING_NAME='jakartamanagementj2ee'
                    ;;
                  
                    *)
                      if [ "${ACTION}" != 'list' ]; then
                        echo '-[ Error
                  ]----------------------------------------------------------------------'
                        echo 'No project selected, exitting.'
                        exit 1
                      else
                        GIT_REPO=''
                      fi
                    ;;
                  
                  esac
                  
                  if [ -n "${GIT_REPO}" ]; then
                    echo '-[ Cloning Project Repository
                  ]-------------------------------------------------'
                    git clone ${GIT_REPO} . && git checkout
                  ${BRANCH}
                    echo '-[ Reading project identifiers
                  ]------------------------------------------------'
                    if [ -n "${BUILD_DIR}" ]; then
                      cd ${BUILD_DIR}
                    fi
                    # Project identifiers
                    ARTIFACT_ID=$(mvn -B ${HELP_PLUGIN}:evaluate
                  -Dexpression=project.artifactId | grep -Ev '(^\[)')
                    GROUP_ID=$(mvn -B ${HELP_PLUGIN}:evaluate
                  -Dexpression=project.groupId | grep -Ev '(^\[)')
                  fi
                  
                  
                  echo "Project:              ${PROJECT} API"
                  echo "Action:               ${ACTION}"
                  echo "Repository ID prefix: ${STAGING_NAME}"
                  echo "Artifact:            
                  ${GROUP_ID}:${ARTIFACT_ID}"
                  
                  
                  case "${ACTION}" in
                  
                    'list')
                  
                      echo '-[ Profiles List
                  ]--------------------------------------------------------------'
                      mvn -B ${NEXUS_PLUGIN_PARAMS}
                  ${NEXUS_PLUGIN}:rc-list-profiles
                      echo '-[ Staging Repository List
                  ]----------------------------------------------------'
                      if [ -n "${STAGING_NAME}" ]; then
                        mvn -B ${NEXUS_PLUGIN_PARAMS}
                  ${NEXUS_PLUGIN}:rc-list | egrep "^\[INFO\]
                  ${STAGING_NAME}\-[0-9]+[ ]+[A-Z]+[ ]" || true
                      else
                        mvn -B ${NEXUS_PLUGIN_PARAMS}
                  ${NEXUS_PLUGIN}:rc-list
                      fi
                      ;;
                  
                    'close')
                  
                      if [ -z "${VERSION}" ]; then
                        echo '-[ Missing version number
                  ]-----------------------------------------------------'
                        exit 1
                      fi
                     
                  STAGING_DESC="${GROUP_ID}:${ARTIFACT_ID}:${VERSION}"
                      echo "Project description:  ${STAGING_DESC}"
                      echo '-[ Searching for open deployment
                  ]----------------------------------------------'
                  
                      # Get the ID of the opem staging repository
                  #    if [ "${PROJECT}" = 'JAX-RPC-API' ]; then
                  #      STAGING_REPO_ID=$(mvn -B ${NEXUS_PLUGIN_PARAMS}
                  ${NEXUS_PLUGIN}:rc-list | \
                  #        egrep "^\[INFO\] .*\-[0-9]+[ ]+OPEN[
                  ]+.*${STAGING_NAME}" | \
                  #        awk '{print $2}' | head -1)
                  #    else
                        STAGING_REPO_ID=$(mvn -B ${NEXUS_PLUGIN_PARAMS}
                  ${NEXUS_PLUGIN}:rc-list | \
                          egrep "^\[INFO\] ${STAGING_NAME}\-[0-9]+[
                  ]+OPEN[ ]" | \
                          awk '{print $2}' | head -1)
                  #    fi
                      echo "Nexus staging repository ID:
                  ${STAGING_REPO_ID}"
                  
                      if [ -n "${STAGING_REPO_ID}" ]; then
                        echo '-[ Closing Nexus staging repository
                  ]-------------------------------------------'
                        mvn -B ${NEXUS_PLUGIN_PARAMS}
                  ${NEXUS_PLUGIN}:rc-close \
                            -DstagingRepositoryId="${STAGING_REPO_ID}" \
                            -DstagingDescription="${STAGING_DESC}"
                      else
                        echo '-[ Delpoyment '${STAGING_NAME}' was not
                  found ]------------------------------------'
                      fi
                      ;;
                  
                    'drop')
                  
                      if [ -z "${VERSION}" ]; then
                        echo '-[ Searching for deployments
                  ]----------------------------------------------'
                        for REPO_ID in $(mvn -B ${NEXUS_PLUGIN_PARAMS}
                  ${NEXUS_PLUGIN}:rc-list | \
                          egrep "^\[INFO\] ${STAGING_NAME}\-[0-9]+[
                  ]+[A-Z]+[ ]" | \
                          awk '{print $2}' | head -1); do
                          echo '-[ Dropping Nexus staging repository
                  ]------------------------------------------'
                          echo "Deployment: ${REPO_ID}"
                          mvn -B ${NEXUS_PLUGIN_PARAMS}
                  ${NEXUS_PLUGIN}:rc-drop \
                              -DstagingRepositoryId="${REPO_ID}"
                        done
                      else
                        mvn -B ${NEXUS_PLUGIN_PARAMS}
                  ${NEXUS_PLUGIN}:rc-drop \
                            -DstagingRepositoryId="${VERSION}"
                      fi
                      ;;
                  
                    release)
                      echo '-[ Action denied for security reasons
                  ]-------------------------------------'
                      ;;
                  
                  esac