From 6548b2d17933e372084b1c4c12a7ed299dc85906 Mon Sep 17 00:00:00 2001
From: pkryshtop <97191009+sl-pkryshtop@users.noreply.github.com>
Date: Wed, 6 Aug 2025 18:16:13 +0300
Subject: [PATCH] feat: deploy to Central Publisher Portal instead of sonatype
OSSRH
---
.circleci/release.sh | 11 ++++++++++-
.circleci/settings.xml | 6 +++---
pom.xml | 45 ++++++++++++++++++++++++++++++++++++++----
3 files changed, 54 insertions(+), 8 deletions(-)
diff --git a/.circleci/release.sh b/.circleci/release.sh
index 9099d2ca..3ac297ac 100755
--- a/.circleci/release.sh
+++ b/.circleci/release.sh
@@ -9,4 +9,13 @@ if ! ./mvnw -Prelease conventional-commits:validate; then
fi
./mvnw -B -Prelease -DskipTests -Darguments='-DskipTests' -s .circleci/settings.xml conventional-commits:version release:prepare
-./mvnw -B -DskipTests -Darguments=-DskipTests -s .circleci/settings.xml release:perform
+
+# Get the tag created by release:prepare
+TAG=$(git describe --tags --abbrev=0)
+echo "Deploying tag: $TAG"
+
+# Checkout the tagged version
+git checkout $TAG
+
+# Deploy using central-publishing-maven-plugin
+./mvnw -B -Prelease -DskipTests -s .circleci/settings.xml clean deploy
diff --git a/.circleci/settings.xml b/.circleci/settings.xml
index ad95e21c..3051899c 100644
--- a/.circleci/settings.xml
+++ b/.circleci/settings.xml
@@ -18,9 +18,9 @@
- sonatype-oss-staging
- ${env.SONATYPE_USERNAME}
- ${env.SONATYPE_PASSWORD}
+ central
+ ${env.CENTRAL_SONATYPE_USERNAME}
+ ${env.CENTRAL_SONATYPE_PASSWORD}
diff --git a/pom.xml b/pom.xml
index 32f461f0..c59381c1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -207,10 +207,6 @@
-
- sonatype-oss-staging
- https://oss.sonatype.org/service/local/staging/deploy/maven2/
-
github
https://maven.pkg.github.com/smartling/java-api-sdk
@@ -238,6 +234,47 @@
v@{project.version}
false
ci:
+
+ prepare
+
+
+
+ org.apache.maven.plugins
+ maven-source-plugin
+ 3.2.1
+
+
+ attach-sources
+
+ jar-no-fork
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-javadoc-plugin
+ 3.1.1
+
+
+ attach-javadocs
+
+ jar
+
+
+
+
+
+ org.sonatype.central
+ central-publishing-maven-plugin
+ 0.8.0
+ true
+
+ central
+ false
+ uploaded
+ required
+ Java API SDK (${project.version})