From 48f986c4d3901801926999690cfa824dd0a38937 Mon Sep 17 00:00:00 2001 From: Jerry Lee Date: Sat, 14 May 2022 23:11:15 +0800 Subject: [PATCH 1/2] add `nexus-staging-maven-plugin` and `maven-enforcer-plugin` for deploy --- pom.xml | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/pom.xml b/pom.xml index b791cf8128..7765846c2a 100644 --- a/pom.xml +++ b/pom.xml @@ -387,6 +387,47 @@ + + + org.sonatype.plugins + nexus-staging-maven-plugin + 1.6.13 + true + + ossrh + https://oss.sonatype.org/ + true + + + + + maven-enforcer-plugin + 3.0.0 + + + enforce-maven + + enforce + + + + + 3.3.9 + + + [1.8,) + + + + + + + From 03467112f8e7ab7ed0e2fc3e11f4a964e9acb6a6 Mon Sep 17 00:00:00 2001 From: Jerry Lee Date: Sat, 14 May 2022 23:12:13 +0800 Subject: [PATCH 2/2] add `maven_deploy_guide.md` --- docs/maven_deploy_guide.md | 46 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 docs/maven_deploy_guide.md diff --git a/docs/maven_deploy_guide.md b/docs/maven_deploy_guide.md new file mode 100644 index 0000000000..b314e2ea92 --- /dev/null +++ b/docs/maven_deploy_guide.md @@ -0,0 +1,46 @@ +# `FASTJSON2`发布操作说明 + +`FASTJSON2`发布到`Maven`中央库的操作过程/CheckList。 + +## 0. 前置准备与配置 + +在`Maven`的`settting.xml`中配置`oss.sonatype.org`账号: + +```xml + + + ossrh + __YOUR_USERNAME__ + __YOUR_PASSWORD__ + + +``` + +更多发布操作说明(如用于`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 + ```