Skip to content

Commit 8dffc5d

Browse files
committed
Fix maven central publishing CTR
Fixes #4828 Signed-off-by: Oleksandr Porunov <[email protected]> (cherry picked from commit f621a1c)
1 parent 0289ebc commit 8dffc5d

File tree

4 files changed

+19
-28
lines changed

4 files changed

+19
-28
lines changed

.github/workflows/ci-publish-commit.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ jobs:
7373
run: |
7474
mkdir -p ~/.m2/
7575
echo "<settingsSecurity><master>$MASTER_PASSWORD</master></settingsSecurity>" > ~/.m2/settings-security.xml
76-
echo "<settings><servers><server><id>ossrh</id><username>$OSSRH_USERNAME</username><password>$OSSRH_PASSWORD</password></server></servers></settings>" > ~/.m2/settings.xml
76+
echo "<settings><servers><server><id>central</id><username>$OSSRH_USERNAME</username><password>$OSSRH_PASSWORD</password></server></servers></settings>" > ~/.m2/settings.xml
7777
env:
7878
MASTER_PASSWORD: ${{ secrets.MASTER_PASSWORD }}
7979
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
@@ -83,4 +83,4 @@ jobs:
8383
- name: Make JanusGraph JAR artifacts
8484
run: mvn clean install -Pjanusgraph-release -DskipTests=true
8585
- name: Deploy JanusGraph JAR artifacts into staging repository
86-
run: mvn deploy -Pjanusgraph-release,janusgraph-commit-release -DskipTests=true -DautoReleaseAfterClose=true -Ddescription="$JG_DESCRIPTION" -DstagingDescription="$JG_DESCRIPTION"
86+
run: mvn deploy -Pjanusgraph-release -DskipTests=true -DwaitUntil=published -DautoPublish=true -Ddescription="$JG_DESCRIPTION" -DstagingDescription="$JG_DESCRIPTION"

.github/workflows/ci-publish-official.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ jobs:
7474
run: |
7575
mkdir -p ~/.m2/
7676
echo "<settingsSecurity><master>$MASTER_PASSWORD</master></settingsSecurity>" > ~/.m2/settings-security.xml
77-
echo "<settings><servers><server><id>ossrh</id><username>$OSSRH_USERNAME</username><password>$OSSRH_PASSWORD</password></server></servers></settings>" > ~/.m2/settings.xml
77+
echo "<settings><servers><server><id>central</id><username>$OSSRH_USERNAME</username><password>$OSSRH_PASSWORD</password></server></servers></settings>" > ~/.m2/settings.xml
7878
env:
7979
MASTER_PASSWORD: ${{ secrets.MASTER_PASSWORD }}
8080
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
@@ -87,7 +87,7 @@ jobs:
8787
- name: Print content of the generated target directory for debugging purposes
8888
run: echo $(ls janusgraph-dist/target/)
8989
- name: Deploy JanusGraph JAR artifacts into staging repository
90-
run: mvn deploy -Pjanusgraph-release -DskipTests=true
90+
run: mvn deploy -Pjanusgraph-release -DskipTests=true -DwaitUntil=validated -DautoPublish=false
9191
- name: Sign JanusGraph full distribution artifact
9292
run: gpg --armor --detach-sign --yes janusgraph-dist/target/${JG_FULL_DIST_NAME}.zip
9393
- name: Install requirements to build documentation

RELEASING.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ See the relevant issue [here.](https://issues.sonatype.org/browse/OSSRH-28274)
2323
* [ ] **For Manual release flow only** Run Deploy to create [Sonatype](https://oss.sonatype.org/#welcome) staging repository and Generate artifacts for release page
2424
* [ ] **For Manual release flow only** Create a draft release and upload artifacts to it
2525
* [ ] Update release description of draft release
26-
* [ ] Close the staging repository in [Sonatype](https://oss.sonatype.org/#stagingRepositories)
26+
* [ ] Close the staging repository in [Sonatype](https://central.sonatype.com/publishing)
2727
* [ ] Convert draft release to a public pre-release
2828
* [ ] Create `[VOTE]` [janusgraph-dev](https://lists.lfaidata.foundation/g/janusgraph-dev) vote thread and [get required votes of 3 TSC members](https://www.apache.org/foundation/voting.html)
2929
* [ ] Release the staging repository in Sonatype
@@ -101,7 +101,7 @@ Steps below were taken from [this guide.](https://maven.apache.org/guides/mini/g
101101
<settings>
102102
<servers>
103103
<server>
104-
<id>ossrh</id>
104+
<id>central</id>
105105
<username>{sonatype username}</username>
106106
<password>{encrypted sonatype password}</password>
107107
</server>
@@ -120,7 +120,7 @@ Otherwise, you will have to type in your gpg passphrase many times when prompted
120120
<settings>
121121
<servers>
122122
<server>
123-
<id>ossrh</id>
123+
<id>central</id>
124124
<username>{sonatype username}</username>
125125
<password>{encrypted sonatype password}</password>
126126
</server>
@@ -249,7 +249,7 @@ git clean -fdx
249249
* Deploy all jars (including javadoc and sources) and all signatures for jars to a staging repository on Sonatype. Notice, this step includes 2 separate commands. The first command will clean repository before generating artifacts and the second command will deploy those generated artifacts. You should not change anything in the repository or run `clean` between the first and the second commands.
250250
```Shell
251251
mvn clean install -Pjanusgraph-release -DskipTests=true
252-
mvn deploy -Pjanusgraph-release -DskipTests=true
252+
mvn deploy -Pjanusgraph-release -DskipTests=true -DwaitUntil=validated -DautoPublish=false
253253
```
254254

255255
* Install MkDocs if not installed. It is needed to build documentation.
@@ -339,7 +339,7 @@ can't be canceled.
339339
### Release the staging repository
340340

341341
When the vote is complete and successful, it is time to finalize the release.
342-
Log into Sonatype and select the [staging repository](https://oss.sonatype.org/#stagingRepositories) that was closed previously.
342+
Log into Sonatype and select the [staging repository](https://central.sonatype.com/publishing) that was closed previously.
343343
Once the release is selected click `Release`.
344344
The staging directory should be automatically deleted after the release is completed.
345345
The release artifacts will be synched over to Maven Central in about 2 hours.

pom.xml

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,8 @@
4747
<distributionManagement>
4848
<snapshotRepository>
4949
<id>ossrh</id>
50-
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
50+
<url>https://central.sonatype.com/repository/maven-snapshots/</url>
5151
</snapshotRepository>
52-
<repository>
53-
<id>ossrh</id>
54-
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
55-
</repository>
5652
</distributionManagement>
5753
<properties>
5854
<titan.compatible-versions>1.0.0,1.1.0-SNAPSHOT</titan.compatible-versions>
@@ -120,6 +116,8 @@
120116
<caffeine.version>2.9.3</caffeine.version>
121117
<checker-qual.version>3.46.0</checker-qual.version>
122118
<curator.version>5.7.0</curator.version>
119+
<autoPublish>false</autoPublish>
120+
<waitUntil>validated</waitUntil>
123121
</properties>
124122
<modules>
125123
<module>janusgraph-grpc</module>
@@ -1550,24 +1548,17 @@
15501548
</execution>
15511549
</executions>
15521550
</plugin>
1553-
</plugins>
1554-
</build>
1555-
</profile>
1556-
1557-
<profile>
1558-
<id>janusgraph-commit-release</id>
1559-
<build>
1560-
<plugins>
15611551
<plugin>
1562-
<groupId>org.sonatype.plugins</groupId>
1563-
<artifactId>nexus-staging-maven-plugin</artifactId>
1564-
<version>1.7.0</version>
1552+
<groupId>org.sonatype.central</groupId>
1553+
<artifactId>central-publishing-maven-plugin</artifactId>
1554+
<version>0.8.0</version>
15651555
<extensions>true</extensions>
15661556
<configuration>
1567-
<!-- The Base URL of Nexus instance where we want to stage -->
1568-
<nexusUrl>https://oss.sonatype.org</nexusUrl>
15691557
<!-- The server "id" element from settings to use authentication from -->
1570-
<serverId>ossrh</serverId>
1558+
<publishingServerId>central</publishingServerId>
1559+
<autoPublish>${autoPublish}</autoPublish>
1560+
<waitUntil>${waitUntil}</waitUntil>
1561+
<waitMaxTime>3600</waitMaxTime>
15711562
</configuration>
15721563
</plugin>
15731564
</plugins>

0 commit comments

Comments
 (0)