如何發布jar包到maven中央倉庫(2024年6月最新版含如何對原Jira系統內數據進行遷移)

1.準備工作

1.1 進入系統注冊賬號

https://central.sonatype.com/

點擊右上角 Sign-in登錄

如果是首次登陸,需要點擊Sign-Up注冊賬號

2.命名空間管理

2.1 注冊Namespaces

點擊右上角自己的賬號->選中View Namespaces

進入命名空間列表后,點擊Add Namespace,然后輸入自己的命名空間名稱

注:此處的命名空間名稱對應的是自己項目里的GroupId

如果命名空間是之前JIRA系統存在,則參考第4章請求官方協助數據遷移。

2.2 校驗Namespaces

按照提示完成域名身份校驗

To prove the ownership of this Namespace, a DNS TXT Record is required with the same value that matches its Verification Key(ticket-123).For the Namespace org.spring.io you will need to create TXT Record:

ticket-123

Domain Registrars services have different procedures for adding a TXT Record, please check your registers documentation to find out how to add a TXT Record.

注意:此處添加TXT記錄時,主機記錄為:@,記錄值為:ticket-123

添加成功后,打開如下地址驗證域名baidu.com*(改成你自己的域名)*

https://www.whatsmydns.net/dns-lookup/txt-records?query=baidu.com&server=google

如果DNS記錄可以查到,說明配置成功,就可以完成校驗

TXT records for baidu.com:

RecordTypeValueTTL
baidu.comTXT“ticket-123”499

3.Maven發布

3.1 啟用Token用戶

選擇 View Account,然后點擊Generate User Token,即可生成maven發布專用用戶。

3.2 GPG證書申請

參考文章

3.3 Maven pom 添加配置 (以Github Action方式正常運行)

<profiles><profile><id>release</id><build><plugins><plugin><groupId>org.sonatype.central</groupId><artifactId>central-publishing-maven-plugin</artifactId><version>0.5.0</version><extensions>true</extensions><configuration><publishingServerId>central</publishingServerId><autoPublish>true</autoPublish></configuration></plugin><plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-source-plugin</artifactId><version>3.3.0</version><executions><execution><id>attach-sources</id><phase>verify</phase><goals><goal>jar-no-fork</goal></goals></execution></executions></plugin><plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-javadoc-plugin</artifactId><version>3.6.3</version><executions><execution><id>attach-javadoc</id><goals><goal>jar</goal></goals></execution></executions><configuration><stylesheet>java</stylesheet><doclint>none</doclint></configuration></plugin><plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-gpg-plugin</artifactId><version>3.1.0</version><executions><execution><id>sign-artifacts</id><phase>verify</phase><goals><goal>sign</goal></goals></execution></executions><configuration><gpgArguments><arg>--pinentry-mode</arg><arg>loopback</arg></gpgArguments></configuration></plugin></plugins></build></profile></profiles><build><plugins><plugin><groupId>org.sonatype.central</groupId><artifactId>central-publishing-maven-plugin</artifactId><version>0.5.0</version><extensions>true</extensions><configuration><publishingServerId>central</publishingServerId><autoPublish>true</autoPublish></configuration></plugin></plugins></build>

3.4 Github Action腳本

name: Publish package to the Maven Central Repository
on:release:types: [created]
jobs:publish:runs-on: ubuntu-lateststeps:- uses: actions/checkout@v4- name: Set up Maven Central Repositoryuses: actions/setup-java@v4with:java-version: '8'distribution: 'temurin'server-id: centralserver-username: MAVEN_USERNAMEserver-password: MAVEN_PASSWORDgpg-private-key: ${{ secrets.GPG_SECRET }}gpg-passphrase: MAVEN_GPG_PASSPHRASE- name: Publish packagerun: mvn -P release --batch-mode deploy -DskipTestsenv:MAVEN_USERNAME: ${{ secrets.OSSRH_USER }}MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSWORD }}

Github Action secrets 如何使用請自行度娘。

4.JIAR 數據遷移

4.1 使用郵箱注冊賬號

如果你還記得JIRA注冊時使用的郵箱,可以使用該郵箱聯系central-support@sonatype.com

如果不記得JIRA注冊時使用的郵箱,則需要使用已經注冊的新賬號綁定的郵箱聯系官方通過DNS方式驗證身份后,官方會協助遷移通過DNS驗證的域名。

4.2 協助溝通郵件記錄(新郵箱)

確認自己身份,請求協助

I’M authorized publisher. , but my old email : xxx can’t login.

I have login in new system by username & password ,

can provide other ways to check authorized publisher. ,eg: doamin add txt record

you can provide String code , I Add txt record to config.

獲得官方回復

Hello,

Can you do the following:

  • Create a user for xxx on https://central.sonatype.com/
  • add the Domain TXT record ticket-12345 to com.baidu

此處com.baidu就是之前JIRA系統申請GroupId時使用的域名,新系統只需要注冊一次即可,不用每個GroupId單獨申請

Regards,
The Central Team

接下來我們只需要按照2.2章節配置DNS,然后給官方發送郵件

hello ,Try again

I have correctly configured the domain name Txt record for :baidu.com

https://www.whatsmydns.net/dns-lookup/txt-records?query=baidu.com&server=google

接下來我們就等候官方回復郵件

Hello ,

Apologies for the confusion, we are up to date on the thread.

We migrated your namespace as requested:

  • your user account on s01.oss.sonatype.org can no longer be used to create deployments for the com.baidu namespace
  • your account on central.sonatype.com associated with 你的新郵箱 has been updated to include the com.baidu namespace

Please login to Central Portal and confirm you see com.baidu as verified under your list of namespaces. After this you could follow the publishing instructions in our documentation to publish your components.

If you have any other question please feel free open a new request.

Thank you,
The Central Team

看到這個郵件后,我們就可以使用新賬號登錄新系統,然后看到對應的namespace官方已經幫我們

遷移到新賬號下面了。

4.3 如果需要使用JIAR繼續發布的參考如下步驟(供參考未驗證)

若是在2024年6月前還正常上傳, 在6月突然不行了. 很大原因是原來使用用戶名,密碼,現要在使用token了.

將maven的settings.xml,

ossrh username password

改為:

ossrh token-username token-password

問題是如何創建token的name及password.

使用原JIRA賬號登錄舊的url,并在以下地址,創建token即可.

https://oss.sonatype.org/#profile;User%20Token

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/diannao/36838.shtml
繁體地址,請注明出處:http://hk.pswp.cn/diannao/36838.shtml
英文地址,請注明出處:http://en.pswp.cn/diannao/36838.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

【軟考論文】項目背景及論文模版

目錄 一、項目核心功能二、論文模板一、項目核心功能 二、論文模板 論文字數說明 總字數 2500 = 500 + 400 +400 * 3 + 300 背景:500 回答問題:400 三段論:1200 = 400 * 3 結論:300 ~ 400 摘要(<300字) 本人于2022年1月參與了某車廠的全渠道數字化精準營銷平臺項目,該…

Spring Boot中實現定時任務最常用的方法 @Scheduled 注解和 TaskScheduler 接口【包含詳情代碼】

Spring Boot中實現定時任務最常用的方法 Scheduled 注解和 TaskScheduler 接口【包含詳情代碼】 學習總結 1、掌握 JAVA入門到進階知識(持續寫作中……&#xff09; 2、學會Oracle數據庫入門到入土用法(創作中……&#xff09; 3、手把手教你開發炫酷的vbs腳本制作(完善中………

全局mixins

一、文章由來 在開發過程中發現在鉤子函數位置直接使用dicts就能直接綁定數據了&#xff0c;由此溯源發現了自己的盲區 二、局部使用 // myMixin.js文件 var myMixin {created: function () {this.hello()},methods: {hello: function () {console.log(hello from mixin!)…

Python數據分析第二課:conda的基礎命令

Python數據分析第二課&#xff1a;conda的基礎命令 1.conda是什么? conda是一個開源的包管理系統&#xff0c;可以幫助我們進行管理多個不同版本的軟件包&#xff0c;還可以幫助我們建立虛擬環境&#xff0c;以便對不同的項目進行隔離。 簡單來說&#xff0c;conda是一個軟…

spacedesk

一、下載鏈接 spacedesk.zip - 藍奏云 二、windows10投屏安卓 windows安裝server&#xff0c;安卓安裝apk 三、windows10投屏到windows10 發現存在臺式機不支持投影&#xff0c;所以有了這個。 投影端 windows安裝server版 spacedesk_driver_Win_10_64_v2119.msi 接收端…

守護生產車間安全:可燃氣體報警器預警與檢測的重要性

近日&#xff0c;東莞一材料廠發生的火災事故再次敲響了工業安全生產的警鐘。 這起事故不僅給工廠帶來了巨大的經濟損失&#xff0c;也暴露了一些企業在安全管理方面的疏漏。其中&#xff0c;可燃氣體報警器的應用與預警功能在火災防范中扮演了至關重要的角色。 接下來&#…

[分布式網絡通訊框架]----RpcProvider實現

在上一節userservice.cc的主函數中&#xff0c;我們初始化以后實例化了一個RpcProvider對象provider。接著調用了它的NotifyService(new UserService)方法&#xff0c;將UserService服務對象及其提供的方法進行預備發布。發布完服務對象后再調用Run()就將預備發布的服務對象及方…

【Docker】可視化平臺Portainer

文章目錄 Portainer的特點Portainer的安裝步驟注意事項 Docker的可視化工具Portainer是一個輕量級的容器管理平臺&#xff0c;它為用戶提供了一個直觀的圖形界面來管理Docker環境。以下是關于Portainer的詳細介紹和安裝步驟&#xff1a; Portainer的特點 輕量級&#xff1a;P…

企業級Windows設備日志采集工具

永久免費: 前往Gitee最新版本 更新內容 進一步提升工程師部署采集客戶端效率. 打開根Url,自動跳轉到部署頁面.(原工程師需輸入很長的Url);新增復制同類客戶端同步任務功能.優化客戶端分組操作;文件同步到服務器后,可配置文件名增加時間戳; 介紹 定時全量或增量采集工控機,…

項目分層--簡單圖書管理系統

分層情況 實體類Book代碼 //實體類 public class Book {private int id;private String name;private int bsum;public Book() {}public Book(int id, String name, int bsum) {this.id id;this.name name;this.bsum bsum;}public int getId() {return id;}public void set…

9.2JavaEE——JDBCTemplate的常用方法(三)query()方法

JdbcTemplate類中常用的查詢方法 方法說明List query(String sql, RowMapper rowMapper)執行String類型參數提供的SQL語句,并通過參數rowMapper返回一個List類型的結果。List query(String sql, PreparedStatementSetter pss, RowMapper rowMapper)根據String類型參數提供的S…

9. Revit API UI: UIView、UIDocument、框選聚焦

9. Revit API UI: UIView、UIDocument、框選聚焦 UI命名空間下的API&#xff0c;到這里差不多就押送講完了&#xff0c;同Application那篇所講的幾個類與接口&#xff0c;都是帶UI的對應了一個不帶UI的&#xff0c;如UIApplication和Application&#xff0c;作用呢&#xff0c…

Jenkins 下使用 Node 和 Npm(借助 nvm-wrapper 插件)構建前端程序

一、前言 搭建完Jenkins后&#xff0c;如何使用node進行構建前端呢&#xff0c;多個項目會使用的node的多個版本。如何動態指定node的版本進行構建呢。 方案一&#xff1a; 安裝多個node版本&#xff0c;然后進行指定。這樣比較麻煩。 方案二&#xff1a; 使用Jenkins的nv…

Spring相關面試題(三)

29 如何在所有的BeanDefinition注冊完成后&#xff0c;進行擴展 Bean工廠的后置處理器&#xff0c;在所有的Bean注冊完成后&#xff0c;就被執行。 public class A implements BeanFactoryPostProcessor {private String name "a class";private B b; ?public St…

ARM芯片架構(RTOS)

前言&#xff1a;筆記韋東山老師的rtos教程&#xff0c;連接放在最后 #ARM介紹 arm芯片屬于精簡指令集risc&#xff0c;所用的指令比較簡單&#xff0c;ARM架構是一種精簡指令集&#xff08;RISC&#xff09;架構&#xff0c;廣泛應用于移動設備、嵌入式系統、物聯網等領域。AR…

Linux:簡單說說分號“;”、單豎線“|”、雙豎線“||”、單“”、雙“”作為多個命令分隔符的用法

以下符號都可以用來連接多個命令&#xff0c;在一行中作為多個命令的分隔符。區別如下&#xff1a; 1、分號“;” 按照先后順序執行命令。每個命令都會在前一個命令執行完畢后立即執行。 如果其中一個命令出現錯誤&#xff0c;后續命令仍然會繼續執行。 2、單豎線“|” 作為管…

2. jenkins發布java項目

jenkins發布java項目 一、環境描述二、部署tomcat業務服務器三、部署git服務器&#xff0c;上傳測試代碼1、部署git服務器2、上傳測試代碼 四、jenkins對接組件1、安裝必要的插件2、對接git客戶端3、對接maven工具4、配置maven需要的jdk5、配置gitlab服務器的連接6、在jenkins上…

1161. 最大層內元素和

1161. 最大層內元素和 題目鏈接&#xff1a;1161. 最大層內元素和 代碼如下&#xff1a; /*** Definition for a binary tree node.* struct TreeNode {* int val;* TreeNode *left;* TreeNode *right;* TreeNode() : val(0), left(nullptr), right(nullptr)…

AI智能體文章索引

1&#xff0c;探索AI世界系列&#xff1a;俗說AI智能體 2&#xff0c;是真的嗎&#xff0c;不會代碼也能開發一款AI應用&#xff1f;GPTs讓人夢想成真 3&#xff0c;來了&#xff0c;你的第一個AI智能體 4&#xff0c;制作一個智能體&#xff1a;抖音熱點話題文案制作助手 5&am…

【Django】網上蛋糕項目商城-首頁

概念 本文在上一文章搭建完數據庫&#xff0c;以及創建好項目之后&#xff0c;以及前端靜態文件后&#xff0c;對項目的首頁功能開發。 后端代碼編寫 這里我們使用pymysql模塊對數據庫進行操作&#xff0c;獲取數據。因此需要在dos窗口使用以下指令下載該庫文件 pip instal…