https://oss.sonatype.org/到期停用了,The OSSRH service will reach end-of-life on June 30th, 2025. Learn more about how to transfer to the Central Publishing Portal here.

使用相同用户名/密码登录到 Maven Central 
到这里https://central.sonatype.com/account生成一个新的帐号密码放到maven/conf/settings.xml中
原来的pom中删除distributionManagement
添加
<plugin>
	<groupId>org.sonatype.central</groupId>
	<artifactId>central-publishing-maven-plugin</artifactId>
	<version>0.8.0</version>
	<extensions>true</extensions>
	<configuration>
		<publishingServerId>ossrh</publishingServerId>
		<autoPublish>true</autoPublish>
		<waitUntil>uploaded</waitUntil>
	</configuration>
</plugin>

需要注意的是:如果要发布快照版本,到这里https://central.sonatype.com/publishing/namespaces 找到对应的命名空间 Enable SNAPSHOTs

否则会提法权限不足
完整POM参考 https://gitee.com/anyline/anyline


升级完成后体验非常友好,原来发布版本时是挨个上传,经常超时,还得手工去后台close,release
anyline一次171多个jar要发布,再加上pom, doc等8个辅助文件,同时发4个版本(jdk8,jdk11,jdk17,jdk21)一个版本发布出去合计就是6156个文件,为了节省时间分好几个批次同时发布,就这样一发也得半天,点了发布后再去干别的,时不时看一下有没有超时,超时了再执行一次。
现在直接压缩成一个文件秒传。