发布到中央
OSSRH 使用说明︎
访问存储库︎
以下存储库允许您直接访问 OSSRH 中的组件。用户只需通过中央存储库直接获取您的组件,但对于项目中的提交者和其他合作者,此列表可能很有用。
- 用于快照部署和下载访问的存储库 URL
-
用于发布部署的存储库 URL,无下载权限!
注意:自 2021 年 2 月起,所有新项目都开始在Nexus Repository Manager上进行配置 。如果您的项目未在https://s01.oss.sonatype.org/ 上配置,您将需要使用旧主机Nexus Repository Manager。
一:注册 Sonatype JIRA 账户:
Sonatype JIRA网站:https://issues.sonatype.org
注册页面:https://issues.sonatype.org/secure/Signup!default.jspa
登录页面:https://issues.sonatype.org/login.jsp
- 注册:
- 注册成功显示:
- 注册成功你会收到一封邮件:
- 首次登录设置语言:
也可在个人资料中设置:https://issues.sonatype.org/secure/ViewProfile.jspa
- 设置头像:
二:创建仓库
- 点击创建问题:
也可以在导航栏点击新建按钮:
- 项目填写:
- 创建完成后如图所示:
- 创建完成你会收到一封邮件:
可能立即给你发送,也可能需要一点时间。
三:验证域名所有权
-
创建完成后这时你会收到一封邮件:
-
解析域名:
-
解析后如图所示:
-
刷新项目页面,点击 Respond:
-
等待验证域名需要一到两天,域名验证成功后,会收到邮件:
-
查看所有项目:
四:安装Gpg4win (切勿使用Windows中文用户名,如果是,请创建英文用户名后再使用)
-
官网:https://www.gpg4win.org/
下载页面:https://www.gpg4win.org/get-gpg4win.html
-
点击 Download 后,即可下载(下载速度较慢,推荐使用迅雷)。
-
安装:
-
语言切换:
-
创建密钥:
点击新建秘钥对:
输入名字和电子邮件:
名字:不支持数字开头。
名字和邮箱输入完成后,点击下一步: -
点击新建:
-
输入密码(Passphrase)和确认密码(Repeat):
输入完成,点击OK: -
完成创建显示:
点击完成即可。
-
可在软件中查看密钥对信息:
五:打包上传
- 创建项目参见:Maven 打包(.jar、-sources.jar、-javadoc.jar)
注意:项目版本不能带有 -SNAPSHOT
- Maven settings.xml 配置:
<server> <id>sonatype-nexus-snapshots</id> <username>sonatype 用户名</username> <password>sonatype 密码</password> </server> <server> <id>sonatype-nexus-staging</id> <username>sonatype 用户名</username> <password>sonatype 密码</password> </server>
- 打包上传:
上面输入 Gpg4win 密码后,可能会出现弹窗,再次输入 Gpg4win 密码:Microsoft Windows [版本 10.0.18362.207] (c) 2019 Microsoft Corporation。保留所有权利。 D:\demo>mvn clean deploy -P sonatype-oss-release [INFO] Scanning for projects... [INFO] [INFO] ---------------------< cn.com.xuxiaowei.json:json >--------------------- [INFO] Building json 1.0 [INFO] --------------------------------[ jar ]--------------------------------- [INFO] [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ json --- [INFO] Deleting D:\demo\target [INFO] [INFO] --- maven-enforcer-plugin:1.2:enforce (enforce-maven) @ json --- [INFO] [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ json --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] Copying 0 resource [INFO] [INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ json --- [INFO] Changes detected - recompiling the module! [INFO] Compiling 2 source files to D:\demo\target\classes [INFO] [INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ json --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] skip non existing resourceDirectory D:\demo\src\test\resources [INFO] [INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ json --- [INFO] Nothing to compile - all classes are up to date [INFO] [INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ json --- [INFO] No tests to run. [INFO] [INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ json --- [INFO] Building jar: D:\demo\target\json-1.0.jar [INFO] [INFO] --- maven-source-plugin:2.1.2:jar-no-fork (attach-sources) @ json --- [INFO] Building jar: D:\demo\target\json-1.0-sources.jar [INFO] [INFO] --- maven-javadoc-plugin:2.7:jar (attach-javadocs) @ json --- [INFO] 正在加载程序包cn.com.xuxiaowei.test.entity的源文件... 正在加载程序包cn.com.xuxiaowei.test的源文件... 正在构造 Javadoc 信息... 标准 Doclet 版本 1.8.0_211 正在构建所有程序包和类的树... 正在生成D:\demo\target\apidocs\cn\com\xuxiaowei\test\entity\Person.html... 正在生成D:\demo\target\apidocs\cn\com\xuxiaowei\test\JSONUtils.html... 正在生成D:\demo\target\apidocs\overview-frame.html... 正在生成D:\demo\target\apidocs\cn\com\xuxiaowei\test\package-frame.html... 正在生成D:\demo\target\apidocs\cn\com\xuxiaowei\test\package-summary.html... 正在生成D:\demo\target\apidocs\cn\com\xuxiaowei\test\package-tree.html... 正在生成D:\demo\target\apidocs\cn\com\xuxiaowei\test\entity\package-frame.html... 正在生成D:\demo\target\apidocs\cn\com\xuxiaowei\test\entity\package-summary.html... 正在生成D:\demo\target\apidocs\cn\com\xuxiaowei\test\entity\package-tree.html... 正在生成D:\demo\target\apidocs\constant-values.html... 正在生成D:\demo\target\apidocs\cn\com\xuxiaowei\test\entity\class-use\Person.html... 正在生成D:\demo\target\apidocs\cn\com\xuxiaowei\test\class-use\JSONUtils.html... 正在生成D:\demo\target\apidocs\cn\com\xuxiaowei\test\package-use.html... 正在生成D:\demo\target\apidocs\cn\com\xuxiaowei\test\entity\package-use.html... 正在构建所有程序包和类的索引... 正在生成D:\demo\target\apidocs\overview-tree.html... 正在生成D:\demo\target\apidocs\index-all.html... 正在生成D:\demo\target\apidocs\deprecated-list.html... 正在构建所有类的索引... 正在生成D:\demo\target\apidocs\allclasses-frame.html... 正在生成D:\demo\target\apidocs\allclasses-noframe.html... 正在生成D:\demo\target\apidocs\index.html... 正在生成D:\demo\target\apidocs\overview-summary.html... 正在生成D:\demo\target\apidocs\help-doc.html... [INFO] Building jar: D:\demo\target\json-1.0-javadoc.jar [INFO] [INFO] --- maven-gpg-plugin:1.1:sign (sign-artifacts) @ json --- GPG Passphrase: 输入 Gpg4win 密码
GPG Passphrase: gpg: WARNING: "--no-use-agent" is an obsolete option - it has no effect gpg: WARNING: "--no-use-agent" is an obsolete option - it has no effect gpg: WARNING: "--no-use-agent" is an obsolete option - it has no effect gpg: WARNING: "--no-use-agent" is an obsolete option - it has no effect [INFO] [INFO] --- maven-install-plugin:2.4:install (default-install) @ json --- [INFO] Installing D:\demo\target\json-1.0.jar to D:\Program Files\apache-maven-3.6.1\repo\cn\com\xuxiaowei\json\json\1.0\json-1.0.jar [INFO] Installing D:\demo\pom.xml to D:\Program Files\apache-maven-3.6.1\repo\cn\com\xuxiaowei\json\json\1.0\json-1.0.pom [INFO] Installing D:\demo\target\json-1.0-sources.jar to D:\Program Files\apache-maven-3.6.1\repo\cn\com\xuxiaowei\json\json\1.0\json-1.0-sources.jar [INFO] Installing D:\demo\target\json-1.0-javadoc.jar to D:\Program Files\apache-maven-3.6.1\repo\cn\com\xuxiaowei\json\json\1.0\json-1.0-javadoc.jar [INFO] Installing D:\demo\target\json-1.0.jar.asc to D:\Program Files\apache-maven-3.6.1\repo\cn\com\xuxiaowei\json\json\1.0\json-1.0.jar.asc [INFO] Installing D:\demo\target\json-1.0.pom.asc to D:\Program Files\apache-maven-3.6.1\repo\cn\com\xuxiaowei\json\json\1.0\json-1.0.pom.asc [INFO] Installing D:\demo\target\json-1.0-sources.jar.asc to D:\Program Files\apache-maven-3.6.1\repo\cn\com\xuxiaowei\json\json\1.0\json-1.0-sources.jar.asc [INFO] Installing D:\demo\target\json-1.0-javadoc.jar.asc to D:\Program Files\apache-maven-3.6.1\repo\cn\com\xuxiaowei\json\json\1.0\json-1.0-javadoc.jar.asc [INFO] [INFO] --- maven-deploy-plugin:2.7:deploy (default-deploy) @ json --- Uploading to sonatype-nexus-staging: https://oss.sonatype.org/service/local/staging/deploy/maven2/cn/com/xuxiaowei/json/json/1.0/json-1.0.jar Uploaded to sonatype-nexus-staging: https://oss.sonatype.org/service/local/staging/deploy/maven2/cn/com/xuxiaowei/json/json/1.0/json-1.0.jar (3.5 kB at 704 B/s) Uploading to sonatype-nexus-staging: https://oss.sonatype.org/service/local/staging/deploy/maven2/cn/com/xuxiaowei/json/json/1.0/json-1.0.pom Uploaded to sonatype-nexus-staging: https://oss.sonatype.org/service/local/staging/deploy/maven2/cn/com/xuxiaowei/json/json/1.0/json-1.0.pom (1.4 kB at 418 B/s) Downloading from sonatype-nexus-staging: https://oss.sonatype.org/service/local/staging/deploy/maven2/cn/com/xuxiaowei/json/json/maven-metadata.xml Downloaded from sonatype-nexus-staging: https://oss.sonatype.org/service/local/staging/deploy/maven2/cn/com/xuxiaowei/json/json/maven-metadata.xml (301 B at 398 B/s) Uploading to sonatype-nexus-staging: https://oss.sonatype.org/service/local/staging/deploy/maven2/cn/com/xuxiaowei/json/json/maven-metadata.xml Uploaded to sonatype-nexus-staging: https://oss.sonatype.org/service/local/staging/deploy/maven2/cn/com/xuxiaowei/json/json/maven-metadata.xml (301 B at 113 B/s) Uploading to sonatype-nexus-staging: https://oss.sonatype.org/service/local/staging/deploy/maven2/cn/com/xuxiaowei/json/json/1.0/json-1.0-sources.jar Uploaded to sonatype-nexus-staging: https://oss.sonatype.org/service/local/staging/deploy/maven2/cn/com/xuxiaowei/json/json/1.0/json-1.0-sources.jar (2.6 kB at 1.1 kB/s) Uploading to sonatype-nexus-staging: https://oss.sonatype.org/service/local/staging/deploy/maven2/cn/com/xuxiaowei/json/json/1.0/json-1.0-javadoc.jar Uploaded to sonatype-nexus-staging: https://oss.sonatype.org/service/local/staging/deploy/maven2/cn/com/xuxiaowei/json/json/1.0/json-1.0-javadoc.jar (38 kB at 13 kB/s) Uploading to sonatype-nexus-staging: https://oss.sonatype.org/service/local/staging/deploy/maven2/cn/com/xuxiaowei/json/json/1.0/json-1.0.jar.asc Uploaded to sonatype-nexus-staging: https://oss.sonatype.org/service/local/staging/deploy/maven2/cn/com/xuxiaowei/json/json/1.0/json-1.0.jar.asc (499 B at 620 B/s) Uploading to sonatype-nexus-staging: https://oss.sonatype.org/service/local/staging/deploy/maven2/cn/com/xuxiaowei/json/json/1.0/json-1.0.pom.asc Uploaded to sonatype-nexus-staging: https://oss.sonatype.org/service/local/staging/deploy/maven2/cn/com/xuxiaowei/json/json/1.0/json-1.0.pom.asc (499 B at 350 B/s) Uploading to sonatype-nexus-staging: https://oss.sonatype.org/service/local/staging/deploy/maven2/cn/com/xuxiaowei/json/json/1.0/json-1.0-sources.jar.asc Uploaded to sonatype-nexus-staging: https://oss.sonatype.org/service/local/staging/deploy/maven2/cn/com/xuxiaowei/json/json/1.0/json-1.0-sources.jar.asc (499 B at 647 B/s) Uploading to sonatype-nexus-staging: https://oss.sonatype.org/service/local/staging/deploy/maven2/cn/com/xuxiaowei/json/json/1.0/json-1.0-javadoc.jar.asc Uploaded to sonatype-nexus-staging: https://oss.sonatype.org/service/local/staging/deploy/maven2/cn/com/xuxiaowei/json/json/1.0/json-1.0-javadoc.jar.asc (499 B at 702 B/s) [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 01:36 min [INFO] Finished at: 2019-07-03T12:36:40+08:00 [INFO] ------------------------------------------------------------------------ D:\demo>
- 查看已上传的jar包:
网址:https://oss.sonatype.org
输入账户密码。
- 查看已上传的jar包及加密信息:
- 在本地目录中查看:
- 双击 .asc 文件查看签名: