Skip to content

Commit 05e9769

Browse files
author
pkryshtop
committed
fix: deploy to Central Publisher Portal instead of sonatype OSSRH
1 parent badff41 commit 05e9769

File tree

4 files changed

+31
-9
lines changed

4 files changed

+31
-9
lines changed

.circleci/config.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,6 @@ workflows:
4949
- test
5050
filters:
5151
branches:
52-
only: master
52+
only:
53+
- master
54+
- deploy-test

.circleci/release.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,13 @@ if ! ./mvnw -Prelease conventional-commits:validate; then
99
fi
1010

1111
./mvnw -B -Prelease -DskipTests -Darguments='-DskipTests' -s .circleci/settings.xml conventional-commits:version release:prepare
12-
./mvnw -B -DskipTests -Darguments=-DskipTests -s .circleci/settings.xml release:perform
12+
13+
# Get the tag created by release:prepare
14+
TAG=$(git describe --tags --abbrev=0)
15+
echo "Deploying tag: $TAG"
16+
17+
# Checkout the tagged version
18+
git checkout $TAG
19+
20+
# Deploy using central-publishing-maven-plugin
21+
./mvnw -B -Prelease -DskipTests -s .circleci/settings.xml clean deploy

.circleci/settings.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818

1919
<servers>
2020
<server>
21-
<id>sonatype-oss-staging</id>
22-
<username>${env.SONATYPE_USERNAME}</username>
23-
<password>${env.SONATYPE_PASSWORD}</password>
21+
<id>central</id>
22+
<username>${env.CENTRAL_SONATYPE_USERNAME}</username>
23+
<password>${env.CENTRAL_SONATYPE_PASSWORD}</password>
2424
</server>
2525
</servers>
2626
</settings>

pom.xml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -207,10 +207,6 @@
207207
</developers>
208208

209209
<distributionManagement>
210-
<repository>
211-
<id>sonatype-oss-staging</id>
212-
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
213-
</repository>
214210
<snapshotRepository>
215211
<id>github</id>
216212
<url>https://maven.pkg.github.com/smartling/java-api-sdk</url>
@@ -238,6 +234,21 @@
238234
<tagNameFormat>v@{project.version}</tagNameFormat>
239235
<allowTimestampedSnapshots>false</allowTimestampedSnapshots>
240236
<scmCommentPrefix xml:space="preserve">ci: </scmCommentPrefix>
237+
<!-- Skip release:perform goal - use central-publishing-maven-plugin instead -->
238+
<goals>prepare</goals>
239+
</configuration>
240+
</plugin>
241+
<plugin>
242+
<groupId>org.sonatype.central</groupId>
243+
<artifactId>central-publishing-maven-plugin</artifactId>
244+
<version>0.8.0</version>
245+
<extensions>true</extensions>
246+
<configuration>
247+
<publishingServerId>central</publishingServerId>
248+
<autoPublish>false</autoPublish>
249+
<waitUntil>uploaded</waitUntil>
250+
<checksums>required</checksums>
251+
<deploymentName>Java API SDK (${project.version})</deploymentName>
241252
</configuration>
242253
</plugin>
243254
</plugins>

0 commit comments

Comments
 (0)