如何完成一次Apache的版本發布
理解Apache發布的內容和流程
總的來說,Source Release是Apache關註的重點,也是發布的必須內容;而Binary Release是可選項,Dubbo可以選擇是否發布二進制包到Apache倉庫或者發布到Maven中央倉庫。
請參考以下鏈接,找到更多關於ASF的發布指南:
Apache Release Guide
Apache Release Policy
本地構建環境準備
主要包括簽名工具、Maven倉庫認證相關準備
安裝GPG,參見 https://www.gnupg.org/download/index.html
如Mac OS
$ brew install gpg
$ gpg --version #檢查版本,應該為2.x
用gpg生成key
根據提示,生成key
$ gpg2 --full-gen-key
gpg (GnuPG) 2.0.12; Copyright (C) 2009 Free Software Foundation, Inc.
This is free software: you are free to change and redistribute it.
Please select what kind of key you want:
(1) RSA and RSA (default)
(2) DSA and Elgamal
(3) DSA (sign only)
(4) RSA (sign only)
Your selection? 1
RSA keys may be between 1024 and 4096 bits long.
What keysize do you want? (2048) 4096
Requested keysize is 4096 bits
0 = key does not expire
<n> = key expires in n days
<n>w = key expires in n weeks
<n>m = key expires in n months
<n>y = key expires in n years
Key is valid for? (0)
Key does not expire at all
Is this correct? (y/N) y
GnuPG needs to construct a user ID to identify your key.
Real name: Robert Burrell Donkin
Email address: [email protected]
Comment: CODE SIGNING KEY
You selected this USER-ID:
"Robert Burrell Donkin (CODE SIGNING KEY) <[email protected]>"
Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? O
You need a Passphrase to protect your secret key. # 填入密碼,以後打包過程中會經常用到
查看key id
$ gpg --list-keys
pub rsa4096/28681CB1 2018-04-26 # 28681CB1就是key id
uid [ultimate] liujun (apache-dubbo) <[email protected]>
sub rsa4096/D3D6984B 2018-04-26
通過key id發送public key到keyserver
$ gpg --keyserver pgpkeys.mit.edu --send-key 28681CB1
其中,pgpkeys.mit.edu為隨意挑選的keyserver,keyserver列表為:https://sks-keyservers.net/status/,因為相互之間是自動同步的,選任意一個都可以。
如果有多個public key,設置默認key
~/.gnupg/gpg.conf
If you have more than 1 secret key in your keyring, you may want to
uncomment the following option and set your preferred keyid.
default-key 28681CB1
設置Apache中央倉庫
Dubbo項目的父pom為apache pom
<parent>
<groupId>org.apache</groupId>
<artifactId>apache</artifactId>
<version>19</version>
</parent>
添加以下內容到.m2/settings.xml
所有密碼請使用maven-encryption-plugin加密後再填入
<settings>
...
<servers>
如何完成一次Apache的版本發布