Skip to content

Commit fbb4696

Browse files
authored
Migration to Maven Central Portal (#1503)
* Update POM file * Remove distributionManagement * Add server-id * Use Organization secrets
1 parent a34c8cf commit fbb4696

File tree

2 files changed

+15
-24
lines changed

2 files changed

+15
-24
lines changed

.github/workflows/publish.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
with: # running setup-java again overwrites the settings.xml
2424
distribution: 'temurin'
2525
java-version: '11'
26-
server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml
26+
server-id: central # Value of the central-publishing-maven-plugin publishingServerId in pom.xml
2727
server-username: MAVEN_USERNAME # env variable for username in deploy
2828
server-password: MAVEN_CENTRAL_TOKEN # env variable for token in deploy
2929
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Value of the GPG private key to import
@@ -32,6 +32,6 @@ jobs:
3232
- name: Publish to Apache Maven Central
3333
run: mvn deploy
3434
env:
35-
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME}}
36-
MAVEN_CENTRAL_TOKEN: ${{ secrets.OSSRH_TOKEN }}
35+
MAVEN_USERNAME: ${{ secrets.SONATYPE_CENTRAL_PORTAL_USERNAME}}
36+
MAVEN_CENTRAL_TOKEN: ${{ secrets.SONATYPE_CENTRAL_PORTAL_PASSWORD }}
3737
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}

pom.xml

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,15 @@
1717
<developers>
1818
<developer>
1919
<name>Adyen</name>
20-
<email>plugin@adyen.com</email>
20+
<email>devrel@adyen.com</email>
2121
<organization>Adyen</organization>
2222
<organizationUrl>https://www.adyen.com</organizationUrl>
2323
</developer>
2424
</developers>
2525
<properties>
26+
<maven.compiler.source>11</maven.compiler.source>
27+
<maven.compiler.target>11</maven.compiler.target>
28+
2629
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
2730
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
2831
<swagger-core-version>1.6.14</swagger-core-version>
@@ -34,23 +37,12 @@
3437
<developerConnection>scm:git:git@github.com:Adyen/adyen-java-api-library.git</developerConnection>
3538
<url>git@github.com:Adyen/adyen-java-api-library.git</url>
3639
</scm>
37-
<distributionManagement>
38-
<repository>
39-
<id>ossrh</id>
40-
<name>Central Repository OSSRH</name>
41-
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
42-
</repository>
43-
</distributionManagement>
4440
<build>
4541
<plugins>
4642
<plugin>
4743
<groupId>org.apache.maven.plugins</groupId>
4844
<artifactId>maven-compiler-plugin</artifactId>
4945
<version>3.13.0</version>
50-
<configuration>
51-
<source>11</source>
52-
<target>11</target>
53-
</configuration>
5446
</plugin>
5547
<plugin>
5648
<groupId>org.apache.maven.plugins</groupId>
@@ -114,9 +106,6 @@
114106
<plugin>
115107
<groupId>org.apache.maven.plugins</groupId>
116108
<artifactId>maven-javadoc-plugin</artifactId>
117-
<configuration>
118-
<source>8</source>
119-
</configuration>
120109
<version>3.11.1</version>
121110
<executions>
122111
<execution>
@@ -141,15 +130,17 @@
141130
</execution>
142131
</executions>
143132
</plugin>
133+
<!-- Publish to Sonatype (Maven Central) -->
144134
<plugin>
145-
<groupId>org.sonatype.plugins</groupId>
146-
<artifactId>nexus-staging-maven-plugin</artifactId>
147-
<version>1.7.0</version>
135+
<groupId>org.sonatype.central</groupId>
136+
<artifactId>central-publishing-maven-plugin</artifactId>
137+
<version>0.7.0</version>
148138
<extensions>true</extensions>
149139
<configuration>
150-
<serverId>ossrh</serverId>
151-
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
152-
<autoReleaseAfterClose>true</autoReleaseAfterClose>
140+
<publishingServerId>central</publishingServerId>
141+
<tokenAuth>true</tokenAuth>
142+
<autoPublish>true</autoPublish>
143+
<waitUntil>published</waitUntil>
153144
</configuration>
154145
</plugin>
155146
<plugin>

0 commit comments

Comments
 (0)