Publish SPI package to Maven Central (post defunct OSSRH)#11905
Publish SPI package to Maven Central (post defunct OSSRH)#11905
Conversation
At #11512 we are tracking the changes we're making get publishing to Maven Central working again now that OSSRH is not supported. We already switched our maven parent package from old to new so I compared these versions to come up with the change in this commit: old (OSSRH): https://github.com/gdcc/maven-parent/blob/ae7b5904d7332259825409faa77545cdff6b84b9/pom.xml new: https://github.com/gdcc/maven-parent/blob/6af0bf07d2134dd4c3f38c58b55479d82922509f/pom.xml See also these docs: https://central.sonatype.org/publish/publish-portal-maven/#automatic-publishing
| @@ -67,19 +67,14 @@ | |||
| <id>central</id> | |||
| <url>https://central.sonatype.com/repository/maven-snapshots/</url> | |||
| </snapshotRepository> | |||
There was a problem hiding this comment.
At https://github.com/IQSS/dataverse/actions/runs/18604319308/job/53050122472?pr=11905 I see "deploy snapshot" is failing with this:
Error: Failed to execute goal org.sonatype.central:central-publishing-maven-plugin:0.9.0:publish (injected-central-publishing) on project dataverse-spi: Failed to deploy artifacts: Could not transfer artifact io.gdcc:dataverse-spi:jar:2.1.0-PR11905-20251017.204025-1 from/to central (https://central.sonatype.com/repository/maven-snapshots/): status code: 401, reason phrase: Unauthorized (401) -> [Help 1]
Hmm. 🤔
|
@poikilotherm I'm putting you on this PR. Thanks for offering to help! As we discussed, we think the GPG secret is ok. We probably need to work more on the pom file. 😬 We also briefly discussed the idea of moving dataverse-spi to a separate repo but we agreed it's an in-depth topic that we should unpack at a future tech hours. I mentioned this at standup today. |
|
I'm closing this PR because in-practice, it's not what we want. It modifies modules/dataverse-spi/pom.xml and meanwhile @poikilotherm has moved all that code to a separate repo: https://github.com/gdcc/dataverse-spi Here's what I think we want:
|
|
This is the proper PR to follow: Thanks, @poikilotherm! ❤️ |
What this PR does / why we need it:
As explained in this issue...
... we need to update all packages that publish to Maven Central to get away from the old OSSRH method.
Which issue(s) this PR closes:
None. Relates to:
Special notes for your reviewer:
I hope this does it. Merge it and see? 🤷
Here's the commit message:
remove defunct ossrh and use central instead
At #11512 we are tracking the changes we're making get publishing to Maven Central working again now that OSSRH is not supported.
We already switched our maven parent package from old to new so I compared these versions to come up with the change in this commit:
old (OSSRH): https://github.com/gdcc/maven-parent/blob/ae7b5904d7332259825409faa77545cdff6b84b9/pom.xml
new: https://github.com/gdcc/maven-parent/blob/6af0bf07d2134dd4c3f38c58b55479d82922509f/pom.xml
See also these docs:
https://central.sonatype.org/publish/publish-portal-maven/#automatic-publishing
Suggestions on how to test this:
It's really hard to test GitHub Actions. If we get a failure after merging, I suppose we can try again.
Addendum
p.s. We have multiple patterns for making library releases to Maven Central and I'm much more familiar with the one I wrote about at https://guides.dataverse.org/en/6.8/developers/making-library-releases.html
If you remove the details, releasing to Maven Central boils down to two commands:
This pattern is used for the exporters, xoai, probably sword, etc. Here's the xoai GitHub Action: https://github.com/gdcc/xoai/blob/76201f0f5eb8f12a5d0a95d797bf43a3431bbbd6/.github/workflows/maven-release.yml
The SPI library uses a different pattern because it's in the main repo. So we don't add a tag to the main repo, for example, when we make an SPI release. Here's the SPI GitHub Action: https://github.com/IQSS/dataverse/blob/bf08caf8edf7457c118312e04c26a853da5de781/.github/workflows/spi_release.yml
Once we understand this "library in the main repo" pattern better, we should add it to the docs above!