Skip to content

Commit e1fe3a9

Browse files
Adjust publication to Maven repository to use central-publishing-maven-plugin (#1513)
* Release attempt * .. * credentials * .. * .. * .. * .. * .. * .. * .. * disable deploy * polish * cleanup 1 * cleanup 2 * bring back original release.yml
1 parent 4e93400 commit e1fe3a9

File tree

5 files changed

+40
-23
lines changed

5 files changed

+40
-23
lines changed

.github/workflows/release.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,18 @@ jobs:
3333
distribution: temurin
3434
java-version: ${{ matrix.version }}
3535
cache: maven
36-
server-id: ossrh-awspring
37-
server-username: OSSRH_USERNAME
38-
server-password: OSSRH_PASSWORD
36+
server-id: central
37+
server-username: CENTRAL_TOKEN_USERNAME
38+
server-password: CENTRAL_TOKEN_PASSWORD
3939
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
4040
gpg-passphrase: MAVEN_GPG_PASSPHRASE
4141
- name: Run tests
4242
run: ./mvnw -V verify javadoc:aggregate -Pspring,docs-classic
4343
- name: Deploy to Sonatype
4444
run: ./mvnw -V -Prelease,spring deploy -DskipTests
4545
env:
46-
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
46+
CENTRAL_TOKEN_USERNAME: ${{ secrets.CENTRAL_TOKEN_USERNAME }}
47+
CENTRAL_TOKEN_PASSWORD: ${{ secrets.CENTRAL_TOKEN_PASSWORD }}
4748
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
4849
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
4950
- 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: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
<module>spring-cloud-aws-test</module>
6060
<module>spring-cloud-aws-modulith</module>
6161
<module>docs</module>
62-
</modules>
62+
</modules>
6363

6464
<dependencyManagement>
6565
<dependencies>
@@ -93,6 +93,15 @@
9393
<build>
9494
<pluginManagement>
9595
<plugins>
96+
<plugin>
97+
<groupId>org.sonatype.central</groupId>
98+
<artifactId>central-publishing-maven-plugin</artifactId>
99+
<version>0.9.0</version>
100+
<extensions>true</extensions>
101+
<configuration>
102+
<publishingServerId>central</publishingServerId>
103+
</configuration>
104+
</plugin>
96105
<plugin>
97106
<artifactId>maven-compiler-plugin</artifactId>
98107
<configuration>
@@ -113,7 +122,7 @@
113122
<version>${spotless.version}</version>
114123
<configuration>
115124
<java>
116-
<importOrder />
125+
<importOrder/>
117126
<eclipse>
118127
<file>${maven.multiModuleProjectDirectory}/eclipse-code-formatter.xml</file>
119128
</eclipse>
@@ -160,6 +169,10 @@
160169
</execution>
161170
</executions>
162171
</plugin>
172+
<plugin>
173+
<groupId>org.sonatype.central</groupId>
174+
<artifactId>central-publishing-maven-plugin</artifactId>
175+
</plugin>
163176
</plugins>
164177
</build>
165178

@@ -307,13 +320,6 @@
307320
</profile>
308321
</profiles>
309322

310-
<distributionManagement>
311-
<repository>
312-
<id>ossrh-awspring</id>
313-
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
314-
</repository>
315-
</distributionManagement>
316-
317323
<licenses>
318324
<license>
319325
<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
@@ -296,6 +296,15 @@
296296
<id>release</id>
297297
<build>
298298
<plugins>
299+
<plugin>
300+
<groupId>org.sonatype.central</groupId>
301+
<artifactId>central-publishing-maven-plugin</artifactId>
302+
<version>0.9.0</version>
303+
<extensions>true</extensions>
304+
<configuration>
305+
<publishingServerId>central</publishingServerId>
306+
</configuration>
307+
</plugin>
299308
<plugin>
300309
<groupId>org.apache.maven.plugins</groupId>
301310
<artifactId>maven-gpg-plugin</artifactId>
@@ -321,11 +330,4 @@
321330
</build>
322331
</profile>
323332
</profiles>
324-
325-
<distributionManagement>
326-
<repository>
327-
<id>ossrh-awspring</id>
328-
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
329-
</repository>
330-
</distributionManagement>
331333
</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)