Skip to content

Commit 62492ce

Browse files
authored
feat: deploy to Central Publisher Portal instead of sonatype OSSRH (#122)
1 parent 25c901e commit 62492ce

File tree

3 files changed

+54
-8
lines changed

3 files changed

+54
-8
lines changed

.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: 41 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,47 @@
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.apache.maven.plugins</groupId>
243+
<artifactId>maven-source-plugin</artifactId>
244+
<version>3.2.1</version>
245+
<executions>
246+
<execution>
247+
<id>attach-sources</id>
248+
<goals>
249+
<goal>jar-no-fork</goal>
250+
</goals>
251+
</execution>
252+
</executions>
253+
</plugin>
254+
<plugin>
255+
<groupId>org.apache.maven.plugins</groupId>
256+
<artifactId>maven-javadoc-plugin</artifactId>
257+
<version>3.1.1</version>
258+
<executions>
259+
<execution>
260+
<id>attach-javadocs</id>
261+
<goals>
262+
<goal>jar</goal>
263+
</goals>
264+
</execution>
265+
</executions>
266+
</plugin>
267+
<plugin>
268+
<groupId>org.sonatype.central</groupId>
269+
<artifactId>central-publishing-maven-plugin</artifactId>
270+
<version>0.8.0</version>
271+
<extensions>true</extensions>
272+
<configuration>
273+
<publishingServerId>central</publishingServerId>
274+
<autoPublish>false</autoPublish>
275+
<waitUntil>uploaded</waitUntil>
276+
<checksums>required</checksums>
277+
<deploymentName>Java API SDK (${project.version})</deploymentName>
241278
</configuration>
242279
</plugin>
243280
</plugins>

0 commit comments

Comments
 (0)