From 491480a067d1452ed011dac9016246a7f7c16200 Mon Sep 17 00:00:00 2001 From: reeshika-h Date: Thu, 23 Oct 2025 15:28:29 +0530 Subject: [PATCH 1/4] testing release workflow --- .github/workflows/maven-publish.yml | 46 ++++++++++--------- .github/workflows/maven.yml | 4 +- pom.xml | 32 +++++++------ .../sdk/marketplace/Marketplace.java | 3 ++ 4 files changed, 48 insertions(+), 37 deletions(-) diff --git a/.github/workflows/maven-publish.yml b/.github/workflows/maven-publish.yml index 0267439..bee0c7c 100644 --- a/.github/workflows/maven-publish.yml +++ b/.github/workflows/maven-publish.yml @@ -1,39 +1,41 @@ -# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created +# This workflow will build a package using Maven and then publish it to Maven Central using the new Central Publishing Plugin # For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#apache-maven-with-a-settings-path name: Maven Package on: + push: + branches: + - fix/DX-3277-release-workflow release: types: [created] jobs: - build: - + publish-maven: runs-on: ubuntu-latest permissions: contents: read packages: write steps: - - uses: actions/checkout@v3 - - name: Set up JDK 11 - uses: actions/setup-java@v3 - with: - java-version: '11' - distribution: 'temurin' - server-id: ossrh - server-username: MAVEN_USERNAME - server-password: MAVEN_PASSWORD - gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} - gpg-passphrase: GPG_PASSPHRASE + - uses: actions/checkout@v3 + - name: Set up Maven Central Repository + uses: actions/setup-java@v3 + with: + java-version: '11' + distribution: 'adopt' + server-id: central + server-username: MAVEN_USERNAME + server-password: MAVEN_PASSWORD + gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} + gpg-passphrase: GPG_PASSPHRASE - - name: Build with Maven - run: mvn -B package --file pom.xml + - name: Build with Maven + run: mvn -B package --file pom.xml - - name: Publish to GitHub Packages Apache Maven - run: mvn --batch-mode -Dgpg.passphrase=${{ secrets.GPG_PASSPHRASE }} deploy - env: - MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} - MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} - GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} + - name: Publish to the Maven Central Repository + run: mvn --batch-mode -Dgpg.passphrase=${{ secrets.GPG_PASSPHRASE }} deploy + env: + MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} + MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} + GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index e5247f5..001e7b5 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -21,10 +21,10 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Set up JDK 17 + - name: Set up JDK 11 uses: actions/setup-java@v3 with: - java-version: '17' + java-version: '11' distribution: 'temurin' cache: maven - name: Build with Maven diff --git a/pom.xml b/pom.xml index 10cd4ba..fa8b544 100644 --- a/pom.xml +++ b/pom.xml @@ -33,7 +33,7 @@ 4.0.0-M9 3.1.0 3.11.0 - 1.6.13 + 0.8.0 3.0.1 @@ -89,23 +89,21 @@ + + ossrh Apache Maven Packages Release https://oss.sonatype.org/service/local/staging/deploy/maven2/ + --> @@ -141,7 +139,7 @@ org.projectlombok lombok ${lombok-source.version} - compile + provided io.github.cdimascio @@ -273,6 +271,13 @@ 8 8 + + + org.projectlombok + lombok + ${lombok-source.version} + + -Xlint:all true true @@ -281,15 +286,16 @@ + - org.sonatype.plugins - nexus-staging-maven-plugin - ${nexus-staging-maven-plugin.version} + org.sonatype.central + central-publishing-maven-plugin + ${central-publishing-maven-plugin.version} true - ossrh - https://oss.sonatype.org/ - true + central + true + published diff --git a/src/main/java/com/contentstack/sdk/marketplace/Marketplace.java b/src/main/java/com/contentstack/sdk/marketplace/Marketplace.java index b1886ff..ebad1fd 100644 --- a/src/main/java/com/contentstack/sdk/marketplace/Marketplace.java +++ b/src/main/java/com/contentstack/sdk/marketplace/Marketplace.java @@ -46,6 +46,9 @@ public static class Builder { public Builder(@NotNull String organizationUid) { + if (organizationUid == null) { + throw new IllegalArgumentException(Constants.ERROR_NO_ORGANIZATION_UID); + } if (organizationUid.isEmpty()) { throw new NullPointerException("Empty fields are not allowed"); } From 15e5ae3c9912d64815cedfa439f1a26ebbddb7c6 Mon Sep 17 00:00:00 2001 From: reeshika-h Date: Thu, 23 Oct 2025 15:31:42 +0530 Subject: [PATCH 2/4] Update version to 1.0.4-beta in pom.xml --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index fa8b544..7483f90 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ 4.0.0 com.contentstack.sdk marketplace - 1.0.3 + 1.0.4-beta Contentstack Java Management SDK for Content Management API https://github.com/contentstack/contentstack-management-java/ From 9ab2788c7491ccc9457f2c9e2ddbe91c69b100a0 Mon Sep 17 00:00:00 2001 From: reeshika-h Date: Thu, 23 Oct 2025 15:36:04 +0530 Subject: [PATCH 3/4] Add project name to pom.xml --- pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/pom.xml b/pom.xml index 7483f90..5d3631b 100644 --- a/pom.xml +++ b/pom.xml @@ -6,6 +6,7 @@ com.contentstack.sdk marketplace 1.0.4-beta + Contentstack Marketplace Java SDK Contentstack Java Management SDK for Content Management API https://github.com/contentstack/contentstack-management-java/ From 487788e91d7dae66af2544f854223b4138221b95 Mon Sep 17 00:00:00 2001 From: reeshika-h Date: Thu, 23 Oct 2025 15:41:16 +0530 Subject: [PATCH 4/4] changed version in pom --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 5d3631b..f0cd851 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ 4.0.0 com.contentstack.sdk marketplace - 1.0.4-beta + 1.0.3 Contentstack Marketplace Java SDK Contentstack Java Management SDK for Content Management API https://github.com/contentstack/contentstack-management-java/