1.注册Sonatype账号
2.项目申请,创建工单
2.1回复
groupId 域名 可以使用github, io.github.账号
创建工单根据评论回复,需要创建临时仓库,验证账户所有权。
3.gpg4win 地址:https://www.gpg4win.org/download.html ,执行 gpg --gen-key 命令新建密钥对。
执行命令后输入 姓名 和 邮箱 还有 Passphase(证书密码),Passphase 需要记住,使用证书的时候会输入密码。
**********
pub ---------
A49F5604BF0CE123UI26E45W38AD1125DA12F4L7
**********
gpg --keyserver hkp://keyserver.ubuntu.com:11371 --send-keys
A49F5604BF0CE123UI26E45W38AD1125DA12F4L7
4. 官方部署文档
4.1 setting.xml
<settings>
<servers>
<server>
<id>ossrh</id>
<username>your-jira-id</username>
<password>your-jira-pwd</password>
</server>
</servers>
<profiles>
<profile>
<id>ossrh</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<gpg.executable>gpg</gpg.executable>
<gpg.passphrase>A49F5604BF0CE123UI26E45W38AD1125DA12F4L7</gpg.passphrase>
</properties>
</profile>
</profiles>
</settings>
4.2 pom.xml
<groupId>io.github.smilexizheng</groupId>
<artifactId>redisson-tool-spring-boot-starter</artifactId>
<version>1.0.0-SNAPSHOT</version>
<name>redisson-tool</name>
<description>Annotation Tool Based on Redisson Implementation</description>
<packaging>jar</packaging>
<licenses>
<license>
<name>The Apache Software License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
</license>
</licenses>
<scm>
<url>https://github.com/smilexizheng/redisson-tool-spring-boot-starter</url>
<connection>scm:git:https://github.com/smilexizheng/redisson-tool-spring-boot-starter.git</connection>
</scm>
<developers>
<developer>
<id>smilesay</id>
<name>smilesay</name>
<email>@qq.com</email>
<roles>
<role>Developer</role>
</roles>
<timezone>+8</timezone>
</developer>
</developers>
<profiles>
<profile>
<id>default</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
<repository>
<id>ossrh</id>
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>
<build>
<plugins>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.7</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.2.1</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9.1</version>
<configuration>
<!-- jdk1.8要加上,1.7要去掉,否则会报错 -->
<additionalJOptions>
<additionalJOption>-Xdoclint:none</additionalJOption>
</additionalJOptions>
</configuration>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.5</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
5. 查询发布 https://s01.oss.sonatype.org/
等待maven中心仓库的同步~~
参考:
https://blog.csdn.net/qq_41973594/article/details/119791466
https://blog.csdn.net/ttzommed/article/details/114697533