Skip to content

Migrate from OSSRH to Central #2892

@cpovirk

Description

@cpovirk

See https://central.sonatype.org/pages/ossrh-eol/ and https://central.sonatype.org/publish/publish-portal-maven/.

I had told @eamonnmcmanus that I would make an attempt at this, but I am emerging defeated... :)

The source-code changes for most of our own migrations have looked like google/truth#1544. I started working on a similar change to GSON, removing <distributionManagement>, removing maven-deploy-plugin from dependencyManagement, and adding central-publishing-maven-plugin to dependencyManagement with <skipPublishing>${gson.isInternalModule}</skipPublishing> inside the configuration section. I also tried listing central-publishing-maven-plugin inside the release profile.

On top of that, we had to create a new user token, following the instructions at https://central.sonatype.org/publish/generate-portal-token/, and plug it into ~/.m2/settings.xml. (I've been using <id>central</id>, but I'm not sure if that exact name is significant.)

Anyway, I was working through the quite detailed instructions at https://github.com/google/gson/blob/main/ReleaseProcess.md (even knowing that I wouldn't ultimately have the permissions to deploy), and I got the impression that maven-release-plugin (which I hadn't used before) is running maven-deploy-plugin whether we want it to or not.

It is probably possible to continue using maven-deploy-plugin (instead of migrating to central-publishing-maven-plugin) by switching to the legacy shim API documented at https://central.sonatype.org/publish/publish-portal-ossrh-staging-api/. However, I and others have had trouble with missing files in our resulting deployments. (Supposedly that is an issue only if you upload different files from different IPs, but that seems highly unlikely in the cases I'm aware of. I think I may at least have heard that there were some potential fixes to remaining issues.) But as a more general point, it's a legacy shim.

The right thing to do is probably to either migrate off maven-release-plugin (at least for the actual deployment) or to find a way to force it to use central-publishing-maven-plugin instead of maven-deploy-plugin (if possible).

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions