Project

General

Profile

Actions

Support #22949

closed

REQUIRED: Update how we upload Java packages

Added by Brett Smith 10 months ago. Updated 5 months ago.

Status:
Resolved
Priority:
Normal
Assigned To:
Category:
SDKs
Target version:
Due date:
Story points:
-
Release relationship:
Auto

Description

build-java-sdk uses OSSRH to upload packages. oss.sonatype.com says:

The OSSRH service will reach end-of-life on June 30th, 2025. Learn more about how to transfer to the Central Publishing Portal here.

So, we need to do that. It doesn't look too difficult. We need to:

  1. Get a new portal token and set it up as a Jenkins credential.
  2. Replace https://oss.sonatype.org with https://ossrh-staging-api.central.sonatype.com in build.gradle.
  3. Reconfigure the job to set ossrhUsername and ossrhPassword properties from the new credentials.
  4. Add a curl call after gradle to call this endpoint with an Authorization header as documented.
Actions #1

Updated by Brett Smith 9 months ago

  • Subject changed from Update how we upload Java packages to REQUIRED: Update how we upload Java packages

Now that the deadline is past due we must do this for our next release.

Actions #2

Updated by Brett Smith 9 months ago

  • Release set to 79
Actions #3

Updated by Brett Smith 8 months ago

  • Description updated (diff)
Actions #4

Updated by Brett Smith 7 months ago

  • Tracker changed from Feature to Support
Actions #5

Updated by Brett Smith 5 months ago

  • Target version set to Development 2025-11-12
  • Assigned To set to Brett Smith
  • Status changed from New to In Progress
Actions #6

Updated by Brett Smith 5 months ago

This is done. It was complicated by the fact that we switched from using the Gradle Docker image to the Gradle in Debian, which is sufficient for testing but apparently doesn't have enough to upload. I'll make a separate ticket about cleaning that up. In the meantime, for posterity, here is our current code for build-java-sdk.

#!/usr/bin/env bash
set -euo pipefail
case "$UPLOAD_PACKAGES" in
  1 | true ) UPLOAD_PACKAGES=uploadArchives ;;
  * ) UPLOAD_PACKAGES= ;;
esac

cp -t "$WORKSPACE/contrib/java-sdk-v2" "$gradle_properties" "$secring" 
docker run --interactive --rm \
  --mount "type=bind,src=$WORKSPACE/contrib/java-sdk-v2,dst=/mnt" \
  --user "$(id -u)" \
  --workdir /mnt \
  gradle:6 \
  gradle -Pversion="$ARVADOS_BUILDING_VERSION" --info --stacktrace \
  clean test jar install $UPLOAD_PACKAGES

if [[ -n "$UPLOAD_PACKAGES" ]]; then
  auth="Authorization: Bearer $(awk '
  (/^ossrhUsername=/) { uname=substr($0, 15); }
  (/^ossrhPassword=/) { pword=substr($0, 15); }
  END { printf("%s:%s", uname, pword); }
' "$gradle_properties" | base64)" 
  curl --data "" --header "$auth" --fail --location --silent --show-error \
  "https://ossrh-staging-api.central.sonatype.com/manual/upload/defaultRepository/org.arvados" 
fi
Actions #7

Updated by Brett Smith 5 months ago

  • Status changed from In Progress to Resolved
Actions

Also available in: Atom PDF