使用相同用户名/密码登录到 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
