
https://central.sonatype.org/faq/what-happened-to-issues-sonatype-org/

https://blog.csdn.net/SpongeBob_shouse/article/details/128803753https://central.sonatype.org/publish-ea/publish-ea-guide/#why-do-we-have-requirements
https://central.sonatype.com/https://central.sonatype.org/register/legacy/

https://central.sonatype.com/
https://central.sonatype.org/register/namespace/#managing-your-credentialsgithub的格式:io.github.你的github的账号usernamegitee的格式:io.gitee.你的gitee的账号username如果你的github、gitee的username是大写的,这里默认使用的是小写,也就是它不区分大小写(如果你的账号是大写注册,这里你填写小写即可)


<html><head>我的page-test</head><body>this is my project<body></html>



<groupId>io.github.bigbigfeifei</groupId>这个是github的是这种搞的,gitee的page估计也是跟github差不多的操作,gitee的pages需要实名认证才可以使用,需要上传身份证正反面和手持身份证正反面的照片,这个也比较严格,经过验证这一步是不需要的,因为我亲测了github这种搞了一个静态页面域名可以访问到,然后发布一个项目可以发布到中央仓库上,然后我的gitee的pages提交的实名认证还没有审核过,gitee就没有发布一个bigbigfeifei.gitee.io的域名能访问到的静态页面,访问的时候是404,然后我也去发布了一个groupId如下的项目,然后去账号后台申请配置下setting的token-username和token后,也是可以正常发到中央仓库,所以这一步可以不做,略过即可
<groupId>io.gitee.bigbigfeifei</groupId>https://central.sonatype.org/faq/how-to-set-txt-record/#by-dns这个里面还有比如阿里云的dns设置啊,就是一些云厂商的dns的设置
Windows:CMD:nslookup -type=TXT yourdomain.comPowershell:yourdomain.com -Type TXTLinux⚓︎host -t txt yourdomain.comdescriptive text "OSSRH-XXYYZZ"ordig -t txt yourdomain.commacOS⚓︎dig -t txt yourdomain.com
https://central.sonatype.org/register/namespace/
根据namespace对应的verification-key去github或gitee代码仓库上创建各自的公开代码仓库如下:https://github.com/BigBigFeiFei/verification-keyxxxxxhttps://gitee.com/BigBigFeiFei/verification-keyxxxxx


https://.htmlhttps://central.sonatype.org/publish/requirements/gpg/#answer
D:\GnuPG\bin\gpg


gpg --keyserver hkp://pool.sks-keyservers.net --send-keys 公钥ID或上面提到的keygpg --keyserver hkp://keyserver.ubuntu.com:11371 --send-keys 你自己的密钥(去重空格)

gpg --keyserver hkp://pool.sks-keyservers.net --recv-keys 公钥ID或上面提到的keygpg --keyserver hkp://keyserver.ubuntu.com:11371 --recv-keys 你自己的密钥(去除空格)

<servers><server><!--id固定是central 每次deploy前就要去后台申请一个新的token,注意申请了新的token不要去点击比如maven的clean等非deploy的按钮,不然这个token就会被使用了,重复使用就会报错401,所以clean要在配置新的token前就去执行了,配置好新的token后,直接点击项目中maven的deploy发布即可--><id>central</id><username>token-username</username><password>token</password></server></servers><profiles><profile><id>central</id><activation><activeByDefault>true</activeByDefault></activation><properties><!-- gpg的安装位置的 GnuPG\bin\gpg,因为我是安装在D盘在,所以没有设置安装路径,所以子在D盘会有两个文件夹GnuPG和\Gpg4win,如果指定了安装路径的话,一个是在一个文件夹下有GnuPG和\Gpg4win,然后配置应该是这种的 安装位置 x盘:\xxxx+\GnuPG\bin\gpg --><gpg.executable>D:\GnuPG\bin\gpg</gpg.executable><gpg.passphrase>你的gpg的密码</gpg.passphrase></properties></profile></profiles>


https://central.sonatype.org/publish/generate-token/
https://central.sonatype.org/publish/requirements/#provide-files-checksums<properties><java.version>1.8</java.version><maven.compiler.source>${java.version}</maven.compiler.source><maven.compiler.target>${java.version}</maven.compiler.target><project.build.sourceEncoding>UTF-8</project.build.sourceEncoding><project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding><serverId>central</serverId><!-- 服务id 也就是setting.xml中的servers.server.id --></properties><build><plugins><!-- 编译插件,设置源码以及编译的jdk版本 --><plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-compiler-plugin</artifactId><configuration><source>${maven.compiler.source}</source><target>${maven.compiler.target}</target></configuration></plugin><!-- Source --><plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-source-plugin</artifactId><version>2.2.1</version><executions><execution><phase>package</phase><goals><goal>jar-no-fork</goal></goals></execution></executions></plugin><!-- Javadoc --><plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-javadoc-plugin</artifactId><version>2.9.1</version><configuration><additionalparam>-Xdoclint:none</additionalparam></configuration><executions><execution><phase>package</phase><goals><goal>jar</goal></goals></execution></executions></plugin><!-- Javadoc --><!-- Gpg Signature --><plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-gpg-plugin</artifactId><version>1.6</version><executions><execution><phase>verify</phase><goals><goal>sign</goal></goals></execution></executions></plugin><!-- 老账号的配置:Gpg Signature --><!--将组件部署到OSSRH并将其发布到Central Repository--><!--<plugin><groupId>org.sonatype.plugins</groupId><artifactId>nexus-staging-maven-plugin</artifactId><version>1.6.8</version><extensions>true</extensions><configuration><serverId>${serverId}</serverId><nexusUrl>https://s01.oss.sonatype.org/</nexusUrl><autoReleaseAfterClose>true</autoReleaseAfterClose></configuration></plugin>--><!--新账号的配置:将组件部署到OSSRH并将其发布到Central Repository--><plugin><groupId>org.sonatype.central</groupId><artifactId>central-publishing-maven-plugin</artifactId><version>0.4.0</version><extensions>true</extensions><configuration><publishingServerId>central</publishingServerId><tokenAuth>true</tokenAuth></configuration></plugin></plugins></build><distributionManagement><snapshotRepository><!-- 与settings.xml的server.id保持一致 --><id>${serverId}</id><url>https://central.sonatype.com/</url></snapshotRepository><!-- 老账号配置<snapshotRepository><!–这个id和settings.xml中servers.server.id要相同,因为上传jar需要登录才有权限–><id>${serverId}</id><name>OSS Snapshots Repository</name><url>https://s01.oss.sonatype.org/content/repositories/snapshots/</url></snapshotRepository><repository><!–这个id和settings.xml中servers.server.id要相同,因为上传jar需要登录才有权限–><id>${serverId}</id><name>OSS Staging Repository</name><url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url></repository>--></distributionManagement>
<groupId>io.github.账号username</groupId>或者:<groupId>io.gitee.账号username</groupId>
<groupId>io.github.bigbigfeifei</groupId><artifactId>es-spring-boot-start</artifactId><!-- 发布到这个上OSSRH:项目中的version,不要带上SNAPSHOT,这样就可以直接发布到中央仓库如果带上了,会发布到私服的snapshots下面,可以搜索进行查看,但是发布到Maven Central的新版本是不支持SNAPSHOT会被校验这个的,如果带来SNAPSHOT则推送失败,所以需要去掉version这个SNAPSHOT。--><version>1.0</version><!--描述一定要有--><description>es启动器</description>
<!--项目访问url --><url>https://github.com/BigBigFeiFei/es-spring-boot-start</url><scm><!--项目访问url --><url>https://github.com/BigBigFeiFei/es-spring-boot-start</url><!--项目访问url.git结尾 --><connection>scm:git:https://github.com/BigBigFeiFei/es-spring-boot-start.git</connection><!--项目访问url.git结尾 --><developerConnection>scm:git:https://github.com/BigBigFeiFei/es-spring-boot-start.git</developerConnection></scm><developers><developer><id>BigFei</id><name>BigFei</name><email>xxxx@qq.com</email><!--项目访问url --><url>https://github.com/BigBigFeiFei/es-spring-boot-start</url><timezone>+8</timezone></developer></developers><licenses><license><name>The Apache Software License, Version 2.0</name><url>http://www.apache.org/licenses/LICENSE-2.0.txt</url></license></licenses>

mvn clean deploy -e//-e参数可以打印出deploy的相关错误信息,以便排查问题
https://www.cnblogs.com/tobyhomels/p/15890023.htmlhttps://blog.csdn.net/zdwzzu2006/article/details/130788625
<plugin><groupId>org.sonatype.plugins</groupId><artifactId>nexus-staging-maven-plugin</artifactId><version>1.6.8</version><extensions>true</extensions><configuration><!--与settings.xml的server.id保持一致 --><serverId>${serverId}</serverId><nexusUrl>https://s01.oss.sonatype.org/</nexusUrl><autoReleaseAfterClose>true</autoReleaseAfterClose></configuration></plugin><distributionManagement><snapshotRepository><!--这个id和settings.xml中servers.server.id要相同,因为上传jar需要登录才有权限 --><id>${serverId}</id><name>OSS Snapshots Repository</name><url>https://s01.oss.sonatype.org/content/repositories/snapshots/</url></snapshotRepository><repository><!--这个id和settings.xml中servers.server.id要相同,因为上传jar需要登录才有权限 --><id>${serverId}</id><name>OSS Staging Repository</name><url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url></repository></distributionManagement>
https://s01.oss.sonatype.org/https://central.sonatype.org/publish/publish-portal-maven/#namespace-details-and-actions<plugin><groupId>org.sonatype.central</groupId><artifactId>central-publishing-maven-plugin</artifactId><version>0.4.0</version><extensions>true</extensions><configuration><publishingServerId>central</publishingServerId><tokenAuth>true</tokenAuth></configuration></plugin>
登录注册地址:https://central.sonatype.com/



在账号的setting中点击





git remote set-url origin https://你的token@github.com/BigBigFeiFei/项目.git-Dfile.encoding=GBK
原文作者:Java大飞哥;如有侵权,请联系管理员删除。