From 8da9c331067e2c0de593b882c60f94250dd8cbd3 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 14 Nov 2025 22:48:32 +0000 Subject: [PATCH 1/5] Initial plan From 31fa60927209283dbe2ce15796a7b59d57849cc9 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 14 Nov 2025 22:53:07 +0000 Subject: [PATCH 2/5] Switch to Central Publisher Portal for Maven publishing Co-authored-by: thomasturrell <1552612+thomasturrell@users.noreply.github.com> --- .github/workflows/maven-publish-snapshot.yml | 6 ++--- .github/workflows/maven-publish.yml | 6 ++--- pom.xml | 24 ++++++++------------ 3 files changed, 16 insertions(+), 20 deletions(-) diff --git a/.github/workflows/maven-publish-snapshot.yml b/.github/workflows/maven-publish-snapshot.yml index aac9a894..e9334f1c 100644 --- a/.github/workflows/maven-publish-snapshot.yml +++ b/.github/workflows/maven-publish-snapshot.yml @@ -19,14 +19,14 @@ jobs: java-version: "17" distribution: "temurin" cache: maven - server-id: ossrh + server-id: central server-username: MAVEN_USERNAME server-password: MAVEN_PASSWORD - name: Publish snapshot package run: mvn -B deploy --file pom.xml env: - MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} - MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} + MAVEN_USERNAME: ${{ secrets.CENTRAL_TOKEN_USERNAME }} + MAVEN_PASSWORD: ${{ secrets.CENTRAL_TOKEN_PASSWORD }} - name: Generate Javadoc run: mvn -B javadoc:javadoc --file pom.xml # This checks that the Javadoc is vaild diff --git a/.github/workflows/maven-publish.yml b/.github/workflows/maven-publish.yml index f6ee55e3..da600c19 100644 --- a/.github/workflows/maven-publish.yml +++ b/.github/workflows/maven-publish.yml @@ -16,7 +16,7 @@ jobs: java-version: "17" distribution: "temurin" cache: maven - server-id: ossrh + server-id: central server-username: MAVEN_USERNAME server-password: MAVEN_PASSWORD gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} @@ -27,6 +27,6 @@ jobs: git config user.email "41898282+github-actions[bot]@users.noreply.github.com" mvn -B -batch-mode release:prepare release:perform --file pom.xml env: - MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} - MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} + MAVEN_USERNAME: ${{ secrets.CENTRAL_TOKEN_USERNAME }} + MAVEN_PASSWORD: ${{ secrets.CENTRAL_TOKEN_PASSWORD }} MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} diff --git a/pom.xml b/pom.xml index af8102f7..5e2e67a3 100644 --- a/pom.xml +++ b/pom.xml @@ -181,14 +181,14 @@ - org.sonatype.plugins - nexus-staging-maven-plugin - 1.7.0 + org.sonatype.central + central-publishing-maven-plugin + 0.6.0 true - ossrh - https://s01.oss.sonatype.org/ - true + central + true + published @@ -301,13 +301,9 @@ - ossrh - https://central.sonatype.com/repository/maven-snapshots/ + central + https://central.sonatype.com/api/v1/publisher/deployments/download/ - - ossrh - https://ossrh-staging-api.central.sonatype.com/service/local/ - @@ -327,8 +323,8 @@ maven-gpg-plugin - org.sonatype.plugins - nexus-staging-maven-plugin + org.sonatype.central + central-publishing-maven-plugin From 6c3386091afd51553af264a2efd3ada4eb0c3708 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 14 Nov 2025 22:54:51 +0000 Subject: [PATCH 3/5] Add RELEASE.md documentation for Central Publisher Portal workflow Co-authored-by: thomasturrell <1552612+thomasturrell@users.noreply.github.com> --- RELEASE.md | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 RELEASE.md diff --git a/RELEASE.md b/RELEASE.md new file mode 100644 index 00000000..e7963ce7 --- /dev/null +++ b/RELEASE.md @@ -0,0 +1,74 @@ +# Release Process + +This document describes the process for releasing xAPI Java to Maven Central. + +## Prerequisites + +The project uses the [Central Publisher Portal](https://central.sonatype.org/publish/publish-portal-maven/) for publishing artifacts to Maven Central. This requires: + +1. A Sonatype account with publishing rights to the `dev.learning.xapi` namespace +2. Generate a user token from [Central Portal](https://central.sonatype.com/) +3. Configure the following GitHub secrets: + - `CENTRAL_TOKEN_USERNAME`: Your Central Portal token username + - `CENTRAL_TOKEN_PASSWORD`: Your Central Portal token password + - `MAVEN_GPG_PRIVATE_KEY`: GPG private key for signing artifacts + - `MAVEN_GPG_PASSPHRASE`: Passphrase for the GPG key + +## Publishing a Release + +Releases are automated using the `Maven Release` GitHub Actions workflow. + +1. Go to the [Actions tab](https://github.com/BerryCloud/xapi-java/actions/workflows/maven-publish.yml) +2. Click "Run workflow" +3. Select the branch to release from (typically `main`) +4. Click "Run workflow" + +The workflow will: +- Prepare the release (update version numbers, create tag) +- Build and sign the artifacts +- Deploy to Central Portal +- Automatically publish to Maven Central (typically available within 30 minutes) + +## Publishing Snapshots + +Snapshot versions are automatically published when pushing to `release-*` branches via the `maven-publish-snapshot.yml` workflow. + +Snapshots are deployed to the Central Portal snapshot repository and are available immediately after the workflow completes. + +## Manual Release (if needed) + +If you need to release manually from your local machine: + +```bash +# Configure your Maven settings.xml with Central Portal credentials +# ~/.m2/settings.xml should include: + + + + central + YOUR_TOKEN_USERNAME + YOUR_TOKEN_PASSWORD + + + + +# Prepare and perform the release +./mvnw release:prepare release:perform +``` + +## Migration from Legacy OSSRH + +The project was previously using the legacy OSSRH Nexus staging workflow. As of version 1.1.16, the project now uses the Central Publisher Portal which offers: + +- Simplified authentication with user tokens +- Direct publishing API without staging repositories +- Faster publication to Maven Central +- Modern, reliable infrastructure + +**No changes are required for consumers** - the artifacts are still published to Maven Central with the same coordinates. + +## Additional Resources + +- [Central Portal Documentation](https://central.sonatype.org/publish/publish-portal-maven/) +- [Maven Release Plugin](https://maven.apache.org/maven-release/maven-release-plugin/) +- [Signing Artifacts](https://central.sonatype.org/publish/requirements/gpg/) From 1de63822a3121d0ca7ceb5d3eb184f7e281bc50d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 15 Nov 2025 11:47:33 +0000 Subject: [PATCH 4/5] Keep existing secret names OSSRH_USERNAME and OSSRH_TOKEN Co-authored-by: thomasturrell <1552612+thomasturrell@users.noreply.github.com> --- .github/workflows/maven-publish-snapshot.yml | 4 ++-- .github/workflows/maven-publish.yml | 4 ++-- RELEASE.md | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/maven-publish-snapshot.yml b/.github/workflows/maven-publish-snapshot.yml index e9334f1c..62cf4a1f 100644 --- a/.github/workflows/maven-publish-snapshot.yml +++ b/.github/workflows/maven-publish-snapshot.yml @@ -26,7 +26,7 @@ jobs: - name: Publish snapshot package run: mvn -B deploy --file pom.xml env: - MAVEN_USERNAME: ${{ secrets.CENTRAL_TOKEN_USERNAME }} - MAVEN_PASSWORD: ${{ secrets.CENTRAL_TOKEN_PASSWORD }} + MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} + MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} - name: Generate Javadoc run: mvn -B javadoc:javadoc --file pom.xml # This checks that the Javadoc is vaild diff --git a/.github/workflows/maven-publish.yml b/.github/workflows/maven-publish.yml index da600c19..cbc6ce45 100644 --- a/.github/workflows/maven-publish.yml +++ b/.github/workflows/maven-publish.yml @@ -27,6 +27,6 @@ jobs: git config user.email "41898282+github-actions[bot]@users.noreply.github.com" mvn -B -batch-mode release:prepare release:perform --file pom.xml env: - MAVEN_USERNAME: ${{ secrets.CENTRAL_TOKEN_USERNAME }} - MAVEN_PASSWORD: ${{ secrets.CENTRAL_TOKEN_PASSWORD }} + MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} + MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} diff --git a/RELEASE.md b/RELEASE.md index e7963ce7..ed4f4d56 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -9,8 +9,8 @@ The project uses the [Central Publisher Portal](https://central.sonatype.org/pub 1. A Sonatype account with publishing rights to the `dev.learning.xapi` namespace 2. Generate a user token from [Central Portal](https://central.sonatype.com/) 3. Configure the following GitHub secrets: - - `CENTRAL_TOKEN_USERNAME`: Your Central Portal token username - - `CENTRAL_TOKEN_PASSWORD`: Your Central Portal token password + - `OSSRH_USERNAME`: Your Central Portal token username + - `OSSRH_TOKEN`: Your Central Portal token password - `MAVEN_GPG_PRIVATE_KEY`: GPG private key for signing artifacts - `MAVEN_GPG_PASSPHRASE`: Passphrase for the GPG key From b2592585993dc293fd56b30a49b3a54a55102a30 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 15 Nov 2025 11:56:47 +0000 Subject: [PATCH 5/5] Remove RELEASE.md documentation Co-authored-by: thomasturrell <1552612+thomasturrell@users.noreply.github.com> --- RELEASE.md | 74 ------------------------------------------------------ 1 file changed, 74 deletions(-) delete mode 100644 RELEASE.md diff --git a/RELEASE.md b/RELEASE.md deleted file mode 100644 index ed4f4d56..00000000 --- a/RELEASE.md +++ /dev/null @@ -1,74 +0,0 @@ -# Release Process - -This document describes the process for releasing xAPI Java to Maven Central. - -## Prerequisites - -The project uses the [Central Publisher Portal](https://central.sonatype.org/publish/publish-portal-maven/) for publishing artifacts to Maven Central. This requires: - -1. A Sonatype account with publishing rights to the `dev.learning.xapi` namespace -2. Generate a user token from [Central Portal](https://central.sonatype.com/) -3. Configure the following GitHub secrets: - - `OSSRH_USERNAME`: Your Central Portal token username - - `OSSRH_TOKEN`: Your Central Portal token password - - `MAVEN_GPG_PRIVATE_KEY`: GPG private key for signing artifacts - - `MAVEN_GPG_PASSPHRASE`: Passphrase for the GPG key - -## Publishing a Release - -Releases are automated using the `Maven Release` GitHub Actions workflow. - -1. Go to the [Actions tab](https://github.com/BerryCloud/xapi-java/actions/workflows/maven-publish.yml) -2. Click "Run workflow" -3. Select the branch to release from (typically `main`) -4. Click "Run workflow" - -The workflow will: -- Prepare the release (update version numbers, create tag) -- Build and sign the artifacts -- Deploy to Central Portal -- Automatically publish to Maven Central (typically available within 30 minutes) - -## Publishing Snapshots - -Snapshot versions are automatically published when pushing to `release-*` branches via the `maven-publish-snapshot.yml` workflow. - -Snapshots are deployed to the Central Portal snapshot repository and are available immediately after the workflow completes. - -## Manual Release (if needed) - -If you need to release manually from your local machine: - -```bash -# Configure your Maven settings.xml with Central Portal credentials -# ~/.m2/settings.xml should include: - - - - central - YOUR_TOKEN_USERNAME - YOUR_TOKEN_PASSWORD - - - - -# Prepare and perform the release -./mvnw release:prepare release:perform -``` - -## Migration from Legacy OSSRH - -The project was previously using the legacy OSSRH Nexus staging workflow. As of version 1.1.16, the project now uses the Central Publisher Portal which offers: - -- Simplified authentication with user tokens -- Direct publishing API without staging repositories -- Faster publication to Maven Central -- Modern, reliable infrastructure - -**No changes are required for consumers** - the artifacts are still published to Maven Central with the same coordinates. - -## Additional Resources - -- [Central Portal Documentation](https://central.sonatype.org/publish/publish-portal-maven/) -- [Maven Release Plugin](https://maven.apache.org/maven-release/maven-release-plugin/) -- [Signing Artifacts](https://central.sonatype.org/publish/requirements/gpg/)