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