Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

MavenReleaseScript

Revision as of 17:00, 30 August 2019 by Starksm64.gmail.com (Talk | contribs) (Sample Maven Central Release Script)

Sample Maven Central Release Script

This page describes a simple Jenkins freestyle job that can be used to optionally list the staging repository ids available to the Jenkins user, and then release a given staging repository. The job has an ID parameter to pass in the staging repository to release.

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
NEXUS_PLUGIN='org.sonatype.plugins:nexus-staging-maven-plugin:1.6.7'
NEXUS_PLUGIN_PARAMS='-DnexusUrl=https://oss.sonatype.org/ -DserverId=ossrh'
mvnq() {
   # filter out progress reports (-B) and download details
   mvn -B "$@" | grep -v '^\[INFO\] Download'
}
# Uncomment to list the available staging repo ids
# mvnq ${NEXUS_PLUGIN_PARAMS} ${NEXUS_PLUGIN}:rc-list
echo "Releasing repositoryID=$ID"
mvnq -DstagingRepositoryId="$ID" ${NEXUS_PLUGIN_PARAMS} ${NEXUS_PLUGIN}:rc-release

The full view of the release job for Jakarta Dependency Injection is shown in the attached release-job.pdf file. File:Release-job.pdf

Back to the top