Clojars發佈項目全流程筆記

##0、確保‘clojars.org’可訪問(關鍵)。html

##1 $ lein new just-for-funredis

##2 project.clj (defproject misty000/just-for-fun "0.0.1"sql

##(3)$ lein deploy clojars (嘗試發佈,提示沒有gpg祕鑰,先安裝gpg) WARNING: please set :url in project.clj. No credentials found for clojars (did you mean lein deploy clojars?) See lein help deploy for how to configure credentials. Username: yours@sohu.com Password: Wrote /home/yours/文檔/Devel/just-for-fun/pom.xml Created /home/yours/文檔/Devel/just-for-fun/target/just-for-fun-0.0.1.jar Could not sign /home/yours/文檔/Devel/just-for-fun/target/just-for-fun-0.0.1.jar gpg: 已建立目錄‘/home/yours/.gnupg’ gpg: 新的配置文件‘/home/yours/.gnupg/gpg.conf’已創建 gpg: 警告:在‘/home/yours/.gnupg/gpg.conf’裏的選項於這次運行期間未被使用 gpg: 鑰匙環‘/home/yours/.gnupg/secring.gpg’已創建 gpg: 鑰匙環‘/home/yours/.gnupg/pubring.gpg’已創建 gpg: no default secret key: 沒有祕匙 gpg: signing failed: 沒有祕匙數據庫

See `lein help gpg` for how to set up gpg.
If you don't expect people to need to verify the authorship of your jar, you
can add `:sign-releases false` to the relevant `:deploy-repositories` entry.

##四、$ gpg --gen-key (gen-key前面是兩個-,選項所有默認便可,問你是否肯定的地方輸入y,彈出小窗口輸兩次私鑰密碼) gpg (GnuPG) 2.0.22; Copyright (C) 2013 Free Software Foundation, Inc. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.maven

請選擇您要使用的密鑰種類:
  (1) RSA and RSA (default)
  (2) DSA and Elgamal
  (3) DSA (僅用於簽名)
  (4) RSA (僅用於簽名)
您的選擇? 
RSA 密鑰長度應在 1024 位與 4096 位之間。
您想要用多大的密鑰尺寸?(2048)
您所要求的密鑰尺寸是 2048 位
請設定這把密鑰的有效期限。
    0 = 密鑰永不過時
  <n>  = 密鑰在 n 天后過時
  <n>w = 密鑰在 n 周後過時
  <n>m = 密鑰在 n 月後過時
  <n>y = 密鑰在 n 年後過時
密鑰的有效期限是?(0) 2y
密鑰於 2015年12月25日 星期五 15時36分03秒 CST 過時
以上正確嗎?(y/n)y

You need a user ID to identify your key; the software constructs the user ID
from the Real Name, Comment and Email Address in this form:
"Heinrich Heine (Der Dichter) <heinrichh@duesseldorf.de>"

真實姓名:Your Name
電子郵件地址:yours@sohu.com
註釋:                                                                                                                
您選定了這個用戶標識:                                                                                                
「Your Name <yours@sohu.com>」
														  
更改姓名(N)、註釋(C)、電子郵件地址(E)或肯定(O)/退出(Q)?o                                                             
您須要一個密碼來保護您的私鑰。                                                                                        
																  
咱們須要生成大量的隨機字節。這個時候您能夠多作些雜事(像是敲打鍵盤、移動
鼠標、讀寫硬盤之類的),這會讓隨機數字發生器有更好的機會得到足夠的熵數。
gpg: /home/yours/.gnupg/trustdb.gpg:創建了信任度數據庫
gpg: 密鑰 02FB1157 被標記爲絕對信任
公鑰和私鑰已經生成並經簽名。

gpg: 正在檢查信任度數據庫
gpg: 須要 3 份勉強信任和 1 份徹底信任,PGP 信任模型
gpg: 深度:0 有效性:  1 已簽名:  0 信任度:0-,0q,0n,0m,0f,1u
gpg: 下次信任度數據庫檢查將於 2015-12-25 進行
pub   2048R/02FB1157 2013-12-25 [有效至:2015-12-25]
密鑰指紋 = 1F1B BCDA 54A5 AD0B 6302  BF17 5AF3 E2CE 02FB 1157
uid                  Your Name <yours@sohu.com>
sub   2048R/D5F2E5EC 2013-12-25 [有效至:2015-12-25]

##五、$ lein deploy clojars WARNING: please set :url in project.clj. No credentials found for clojars (did you mean lein deploy clojars?) See lein help deploy for how to configure credentials. Username: yours@sohu.com ;;; 'clojars.org'的登陸名/密碼 Password: Wrote /home/yours/文檔/Devel/just-for-fun/pom.xml Created /home/yours/文檔/Devel/just-for-fun/target/just-for-fun-0.0.1.jaride

您須要輸入密碼,才能解開這個用戶的私鑰:「Your Name <yours@sohu.com>」
2048 位的 RSA 密鑰,鑰匙號 02FB1157,創建於 2013-12-25
    ;;; 彈出窗口中輸入以前設置的私鑰密碼


您須要輸入密碼,才能解開這個用戶的私鑰:「Your Name <yours@sohu.com>」
2048 位的 RSA 密鑰,鑰匙號 02FB1157,創建於 2013-12-25

Sending misty000/just-for-fun/0.0.1/just-for-fun-0.0.1.pom (3k)
to https://clojars.org/repo/
Sending misty000/just-for-fun/0.0.1/just-for-fun-0.0.1.jar (7k)
to https://clojars.org/repo/
Sending misty000/just-for-fun/0.0.1/just-for-fun-0.0.1.jar.asc (1k)
to https://clojars.org/repo/
Sending misty000/just-for-fun/0.0.1/just-for-fun-0.0.1.pom.asc (1k)
to https://clojars.org/repo/
Could not find metadata misty000:just-for-fun/maven-metadata.xml in clojars (https://clojars.org/repo/)
Sending misty000/just-for-fun/maven-metadata.xml (1k)
to https://clojars.org/repo/

注1:Clojars的Profile中未設置‘SSH public key’和‘PGP public key’,但發佈成功。 注2:項目頁面中有一些提示信息: promotion Missing scm Could not verify signature of /home/clojars/repo/misty000/just-for-fun/0.0.1/just-for-fun-0.0.1.jar. Ensure your public key is in your profile. Could not verify signature of /home/clojars/repo/misty000/just-for-fun/0.0.1/just-for-fun-0.0.1.pom. Ensure your public key is in your profile. (沒法覈實簽名。確保profile中已經設置了public key。(應該指的是‘PGP public key’))測試

##(6)、$ lein new just-for-fun-test (建立測試項目) project.clj add [misty000/just-for-fun "0.0.1"] to :dependencies $ cd just-for-fun-test/ $ lein deps Retrieving misty000/just-for-fun/0.0.1/just-for-fun-0.0.1.pom from clojars Retrieving misty000/just-for-fun/0.0.1/just-for-fun-0.0.1.jar from clojarsui

##七、$ gpg --list-keys /home/yours/.gnupg/pubring.gpg ------------------------------ pub 2048R/02FB1157 2013-12-25 [有效至:2015-12-25] uid Your Name yours@sohu.com sub 2048R/D5F2E5EC 2013-12-25 [有效至:2015-12-25]this

$ gpg --export -a 02FB1157
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v2.0.22 (GNU/Linux)

mQENBFK6i0IBCADDLwsypKz6nhn8dJsSoRBuxR7yRaGOpyP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EleB2XnSwDZC52301MK5osCpe4EIZg
O8G+Qpse5E4gQG8hiZ8YSFU7i0We4owpJwARAQABiQElBBgBAgAPBQJSuotCAhsM
BQkDwmcAAAoJEFrz4s4C+xFXI5sH/i6gL3kyQdibxHGBTzEWalXLPbd8ErobTr3t
31FoHdBp3zo3s/QXQ8FmxC5b9Ib0rg33wxkWUL1HA4hQ6mqCpQlkCQCdVSB69HJJ
piOCktha0/WSMW5Z9Xw9B2MTk9VhqE5Mx25xhyB5+kts9bC7mTs3bPrGcx7ucjUr
JHrTD5vP3kTDLh3uQ7Js4iUMWBLzP6sO7mDnpTZKxwu1/q5p7OcWwg/2qDyNe+Fq
N7+aXHTQBUqHq2BBeFHZ/2r7uP0wfEacFiqEeie7zgbGRmpnuTnvdutBfM8dUgLo
dViUGfisVRvdOsg0XYpMUHahu2xCHLLz5wfWj/NQL+q9n+Y/ukI=
=RMB2
-----END PGP PUBLIC KEY BLOCK-----

注1:這裏要用公鑰,即:02FB1157 注2:將生成的‘PGP PUBLIC KEY’粘貼到‘https://clojars.org/profile’的‘PGP public key:’文本框,包括‘-----BEGIN PGP PUBLIC KEY BLOCK-----’和‘-----END PGP PUBLIC KEY BLOCK-----’ 注3:步驟5注2中的簽名警告已經消除,‘Missing scm’不知道如何消除。url

##(8)、$ lein deploy clojars (嘗試從新發布,發佈失敗,應該是版本號重複的緣由) WARNING: please set :url in project.clj. No credentials found for clojars (did you mean lein deploy clojars?) See lein help deploy for how to configure credentials. Username: yours@sohu.com Password: Wrote /home/yours/文檔/Devel/just-for-fun/pom.xml Created /home/yours/文檔/Devel/just-for-fun/target/just-for-fun-0.0.1.jar

您須要輸入密碼,才能解開這個用戶的私鑰:「Your Name <yours@sohu.com>」
2048 位的 RSA 密鑰,鑰匙號 02FB1157,創建於 2013-12-25


您須要輸入密碼,才能解開這個用戶的私鑰:「Your Name <yours@sohu.com>」
2048 位的 RSA 密鑰,鑰匙號 02FB1157,創建於 2013-12-25

Sending misty000/just-for-fun/0.0.1/just-for-fun-0.0.1.pom (3k)
to https://clojars.org/repo/
Could not transfer artifact misty000:just-for-fun:pom:0.0.1 from/to clojars (https://clojars.org/repo/): Access denied to: https://clojars.org/repo/misty000/just-for-fun/0.0.1/just-for-fun-0.0.1.pom, ReasonPhrase: Forbidden.
Sending misty000/just-for-fun/0.0.1/just-for-fun-0.0.1.jar (7k)
to https://clojars.org/repo/
Could not transfer artifact misty000:just-for-fun:jar:0.0.1 from/to clojars (https://clojars.org/repo/): Access denied to: https://clojars.org/repo/misty000/just-for-fun/0.0.1/just-for-fun-0.0.1.jar, ReasonPhrase: Forbidden.
Sending misty000/just-for-fun/0.0.1/just-for-fun-0.0.1.jar.asc (1k)
to https://clojars.org/repo/
Could not transfer artifact misty000:just-for-fun:jar.asc:0.0.1 from/to clojars (https://clojars.org/repo/): Access denied to: https://clojars.org/repo/misty000/just-for-fun/0.0.1/just-for-fun-0.0.1.jar.asc, ReasonPhrase: Forbidden.
Sending misty000/just-for-fun/0.0.1/just-for-fun-0.0.1.pom.asc (1k)
to https://clojars.org/repo/
Could not transfer artifact misty000:just-for-fun:pom.asc:0.0.1 from/to clojars (https://clojars.org/repo/): Access denied to: https://clojars.org/repo/misty000/just-for-fun/0.0.1/just-for-fun-0.0.1.pom.asc, ReasonPhrase: Forbidden.
Failed to deploy artifacts: Could not transfer artifact misty000:just-for-fun:pom:0.0.1 from/to clojars (https://clojars.org/repo/): Access denied to: https://clojars.org/repo/misty000/just-for-fun/0.0.1/just-for-fun-0.0.1.pom, ReasonPhrase: Forbidden.

注:已經發布過的版本從新發佈會被拒絕。

##(9)、just-for-jun項目project.clj (提高版本號後從新發布) (defproject misty000/just-for-fun "0.0.2"

$ lein deploy clojars
WARNING: please set :url in project.clj.
No credentials found for clojars (did you mean `lein deploy clojars`?)
See `lein help deploy` for how to configure credentials.
Username: yours@sohu.com
Password: 
Wrote /home/yours/文檔/Devel/just-for-fun/pom.xml
Created /home/yours/文檔/Devel/just-for-fun/target/just-for-fun-0.0.2.jar

您須要輸入密碼,才能解開這個用戶的私鑰:「Your Name <yours@sohu.com>」
2048 位的 RSA 密鑰,鑰匙號 02FB1157,創建於 2013-12-25


您須要輸入密碼,才能解開這個用戶的私鑰:「Your Name <yours@sohu.com>」
2048 位的 RSA 密鑰,鑰匙號 02FB1157,創建於 2013-12-25

Sending misty000/just-for-fun/0.0.2/just-for-fun-0.0.2.pom (3k)
to https://clojars.org/repo/
Sending misty000/just-for-fun/0.0.2/just-for-fun-0.0.2.jar (7k)
to https://clojars.org/repo/
Sending misty000/just-for-fun/0.0.2/just-for-fun-0.0.2.jar.asc (1k)
to https://clojars.org/repo/
Sending misty000/just-for-fun/0.0.2/just-for-fun-0.0.2.pom.asc (1k)
to https://clojars.org/repo/
Retrieving misty000/just-for-fun/maven-metadata.xml (1k)
from https://clojars.org/repo/
Sending misty000/just-for-fun/maven-metadata.xml (1k)
to https://clojars.org/repo/

注:提高版本號後發佈成功。

##十、‘https://clojars.org/profile’中的‘SSH public key’不知道有什麼用。

相關文章
相關標籤/搜索