Skip to content

Commit 9e6db5a

Browse files
committed
Fix snapshot publishing
Motivation: Enable snapshot publishing again. Modification: Add a distribution management section to the pom.xml file, that enables `-SNAPSHOT` distribution. This follows the guidance from https://central.sonatype.org/publish/publish-portal-snapshots/#enabling-snapshot-releases-for-your-namespace Move the maven settings actions to after the java installer action, to avoid it being overwritten in the install. Also add the central-snapshot server with username and password to allow publishing snapshots. Result: Snapshot releases works again.
1 parent 32d5d6e commit 9e6db5a

File tree

2 files changed

+29
-18
lines changed

2 files changed

+29
-18
lines changed

.github/workflows/ci-deploy.yml

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,6 @@ jobs:
3232
deploy:
3333
runs-on: ubuntu-latest
3434
steps:
35-
- uses: s4u/maven-settings-action@v3.0.0
36-
with:
37-
servers: |
38-
[{
39-
"id": "central",
40-
"username": "${{ secrets.MAVEN_CENTRAL_USERNAME }}",
41-
"password": "${{ secrets.MAVEN_CENTRAL_PASSWORD }}"
42-
}]
4335

4436
- uses: actions/checkout@v4
4537

@@ -49,6 +41,21 @@ jobs:
4941
distribution: 'zulu'
5042
java-version: '8'
5143

44+
- uses: s4u/maven-settings-action@v3.0.0
45+
with:
46+
githubServer: false
47+
servers: |
48+
[{
49+
"id": "central",
50+
"username": "${{ secrets.MAVEN_CENTRAL_USERNAME }}",
51+
"password": "${{ secrets.MAVEN_CENTRAL_PASSWORD }}"
52+
},
53+
{
54+
"id": "central-portal-snapshots",
55+
"username": "${{ secrets.MAVEN_CENTRAL_USERNAME }}",
56+
"password": "${{ secrets.MAVEN_CENTRAL_PASSWORD }}"
57+
}]
58+
5259
# Cache .m2/repository
5360
- uses: actions/cache@v4
5461
continue-on-error: true

pom.xml

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,20 @@
4545
</licenses>
4646
<inceptionYear>2021</inceptionYear>
4747

48+
<distributionManagement>
49+
<snapshotRepository>
50+
<name>Central Portal Snapshots</name>
51+
<id>central-portal-snapshots</id>
52+
<url>https://central.sonatype.com/repository/maven-snapshots/</url>
53+
<releases>
54+
<enabled>false</enabled>
55+
</releases>
56+
<snapshots>
57+
<enabled>true</enabled>
58+
</snapshots>
59+
</snapshotRepository>
60+
</distributionManagement>
61+
4862
<scm>
4963
<url>https://github.com/netty/netty-incubator-h3spec-maven-plugin</url>
5064
<connection>scm:git:git://github.com/netty/netty-incubator-h3spec-maven-plugin.git</connection>
@@ -224,16 +238,6 @@
224238
</execution>
225239
</executions>
226240
</plugin>
227-
<plugin>
228-
<groupId>org.sonatype.central</groupId>
229-
<artifactId>central-publishing-maven-plugin</artifactId>
230-
<version>0.7.0</version>
231-
<extensions>true</extensions>
232-
<configuration>
233-
<publishingServerId>central</publishingServerId>
234-
<centralSnapshotsUrl>https://central.sonatype.com/repository/maven-snapshots/</centralSnapshotsUrl>
235-
</configuration>
236-
</plugin>
237241
<plugin>
238242
<artifactId>maven-release-plugin</artifactId>
239243
<version>2.5.3</version>

0 commit comments

Comments
 (0)