本文是以上传 https://oss.sonatype.org/ maven中央仓库为例
注册地址: https://issues.sonatype.org ,这里的账号和密码一定要记住。
Create 创建工单:
com.qianxunclub ,因为这个是我自己的域名,管理员会问qianxunclub.com这个是不是自己的网站,回答是就好了,如果使用 com.github.xxxxx 之类的,会方便一些。 https://gitee.com/qianxunclub/qianxunclub-maven-plugin 然后点击发布会成功创建一个工单,工单状态为:open
Issue 选择自己的工单:
等到审核状态为 RESOLVED ,恭喜你,审核已经成功,第一次审核要一天左右 ,因为时差原因,他们工作时间是我们的晚上,之后在创建工单如果GroupId 满足基本要求基本就是秒过。
settings.xml 文件,添加以下内容: <servers>
<server>
<id>snapshots</id>
<username>https://issues.sonatype.org的注册账号</username>
<password>https://issues.sonatype.org的注册密码</password>
</server>
</servers>
这里注意以下,如果使用特殊符号,是需要转义的,例如: pwd& ,密码要填写成 pwd&
pom.xml ,添加以下内容: <distributionManagement>
<repository>
<id>snapshots</id>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
</repository>
<snapshotRepository>
<id>snapshots</id>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
</snapshotRepository>
</distributionManagement>
mvn clean package deploy
出现 success 字样,代表已经成功,可以在 https://oss.sonatype.org/content/groups/public 找到自己的jar包了。