Skip to content

Commit

Permalink
Merge branch 'pollish-deploy-process'
Browse files Browse the repository at this point in the history
  • Loading branch information
oldratlee committed May 14, 2022
2 parents dcf6ed7 + 0346711 commit 87d212e
Show file tree
Hide file tree
Showing 2 changed files with 87 additions and 0 deletions.
46 changes: 46 additions & 0 deletions docs/maven_deploy_guide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# `FASTJSON2`发布操作说明

`FASTJSON2`发布到`Maven`中央库的操作过程/CheckList。

## 0. 前置准备与配置

`Maven``settting.xml`中配置`oss.sonatype.org`账号:

```xml
<servers>
<server>
<id>ossrh</id>
<username>__YOUR_USERNAME__</username>
<password>__YOUR_PASSWORD__</password>
</server>
</servers>
```

更多发布操作说明(如用于`GPG`签名的`GPG`安装与配置),参见:

- OSSRH Guide
https://central.sonatype.org/pages/ossrh-guide.html
- Deploying to OSSRH with Apache Maven - Introduction
https://central.sonatype.org/pages/apache-maven.html

发布过程与发布文件的查看地址:

- sonatype的发布控制台
https://oss.sonatype.org/index.html
- Maven中央库的文件查看
https://repo1.maven.org/maven2/com/alibaba/fastjson2/


## 1. 发布操作

1. 如果发布正式版本,先确认版本号,去掉`SNAPSHOT`,如`2.x.y`
1. 更新版本操作可以通过脚本[`scripts/bump_fastjson2_version`](../scripts/bump_fastjson2_version)来统一完成。

```bash
scripts/bump_fastjson2_version 2.x.y
```
1. 在工程根目录,执行发布

```bash
./mvnw clean && ./mvnw deploy -DperformRelease
```
41 changes: 41 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,47 @@
</distributionManagement>

<build>
<plugins>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.13</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>
<!--
official docs: https://maven.apache.org/enforcer/enforcer-rules/requireMavenVersion.html
add maven-enforce-plugin to make sure the right jdk is used
https://stackoverflow.com/a/18420462/922688
-->
<plugin>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<id>enforce-maven</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireMavenVersion>
<version>3.3.9</version>
</requireMavenVersion>
<requireJavaVersion>
<version>[1.8,)</version>
</requireJavaVersion>
</rules>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<plugin>
Expand Down

0 comments on commit 87d212e

Please sign in to comment.