Skip to content

Commit 90a8d0f

Browse files
Adjust publication to Maven repository to use central-publishing-maven-plugin (#1515)
1 parent db0cc89 commit 90a8d0f

File tree

5 files changed

+40
-22
lines changed

5 files changed

+40
-22
lines changed

.github/workflows/release.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ name: Release
22

33
on:
44
push:
5+
branches: [ maven-central-publishing ]
56
tags:
67
- v2.3.*
78
- v2.4.*
@@ -33,17 +34,18 @@ jobs:
3334
distribution: temurin
3435
java-version: ${{ matrix.version }}
3536
cache: maven
36-
server-id: ossrh-awspring
37-
server-username: OSSRH_USERNAME
38-
server-password: OSSRH_PASSWORD
37+
server-id: central
38+
server-username: CENTRAL_TOKEN_USERNAME
39+
server-password: CENTRAL_TOKEN_PASSWORD
3940
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
4041
gpg-passphrase: MAVEN_GPG_PASSPHRASE
4142
- name: Run tests
4243
run: ./mvnw -V verify javadoc:aggregate -Pspring,docs-classic
4344
- name: Deploy to Sonatype
4445
run: ./mvnw -V -Prelease,spring deploy -DskipTests
4546
env:
46-
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
47+
CENTRAL_TOKEN_USERNAME: ${{ secrets.CENTRAL_TOKEN_USERNAME }}
48+
CENTRAL_TOKEN_PASSWORD: ${{ secrets.CENTRAL_TOKEN_PASSWORD }}
4749
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
4850
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
4951
- name: Upload to S3

.settings.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
<settings>
33
<servers>
44
<server>
5-
<id>repo.spring.io</id>
6-
<username>${env.CI_DEPLOY_USERNAME}</username>
7-
<password>${env.CI_DEPLOY_PASSWORD}</password>
5+
<id>central</id>
6+
<username>${env.CENTRAL_TOKEN_USERNAME}</username>
7+
<password>${env.CENTRAL_TOKEN_PASSWORD}</password>
88
</server>
99
</servers>
1010
<profiles>

pom.xml

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,15 @@
102102
<build>
103103
<pluginManagement>
104104
<plugins>
105+
<plugin>
106+
<groupId>org.sonatype.central</groupId>
107+
<artifactId>central-publishing-maven-plugin</artifactId>
108+
<version>0.9.0</version>
109+
<extensions>true</extensions>
110+
<configuration>
111+
<publishingServerId>central</publishingServerId>
112+
</configuration>
113+
</plugin>
105114
<plugin>
106115
<artifactId>maven-compiler-plugin</artifactId>
107116
<configuration>
@@ -122,7 +131,7 @@
122131
<version>${spotless.version}</version>
123132
<configuration>
124133
<java>
125-
<importOrder />
134+
<importOrder/>
126135
<eclipse>
127136
<file>${maven.multiModuleProjectDirectory}/eclipse-code-formatter.xml</file>
128137
</eclipse>
@@ -169,6 +178,10 @@
169178
</execution>
170179
</executions>
171180
</plugin>
181+
<plugin>
182+
<groupId>org.sonatype.central</groupId>
183+
<artifactId>central-publishing-maven-plugin</artifactId>
184+
</plugin>
172185
</plugins>
173186
</build>
174187

@@ -316,13 +329,6 @@
316329
</profile>
317330
</profiles>
318331

319-
<distributionManagement>
320-
<repository>
321-
<id>ossrh-awspring</id>
322-
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
323-
</repository>
324-
</distributionManagement>
325-
326332
<licenses>
327333
<license>
328334
<name>Apache License, Version 2.0</name>

spring-cloud-aws-dependencies/pom.xml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,15 @@
353353
<id>release</id>
354354
<build>
355355
<plugins>
356+
<plugin>
357+
<groupId>org.sonatype.central</groupId>
358+
<artifactId>central-publishing-maven-plugin</artifactId>
359+
<version>0.9.0</version>
360+
<extensions>true</extensions>
361+
<configuration>
362+
<publishingServerId>central</publishingServerId>
363+
</configuration>
364+
</plugin>
356365
<plugin>
357366
<groupId>org.apache.maven.plugins</groupId>
358367
<artifactId>maven-gpg-plugin</artifactId>
@@ -378,11 +387,4 @@
378387
</build>
379388
</profile>
380389
</profiles>
381-
382-
<distributionManagement>
383-
<repository>
384-
<id>ossrh-awspring</id>
385-
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
386-
</repository>
387-
</distributionManagement>
388390
</project>

spring-cloud-aws-samples/pom.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,14 @@
4949
<skip>true</skip>
5050
</configuration>
5151
</plugin>
52+
<plugin>
53+
<groupId>org.sonatype.central</groupId>
54+
<artifactId>central-publishing-maven-plugin</artifactId>
55+
<extensions>true</extensions>
56+
<configuration>
57+
<skipPublishing>true</skipPublishing>
58+
</configuration>
59+
</plugin>
5260
</plugins>
5361
</build>
5462
<dependencyManagement>

0 commit comments

Comments
 (0)