首頁> Java> java教程> 主體

Java開源開發者指南:構建並部署到Maven Central

王林
發布: 2024-07-29 16:45:10
原創
957 人瀏覽過

目錄

  • 建立GitHub帳戶(如果還沒有)
  • 申請Maven Central Repository帳戶
  • Java Doc
  • 發佈設定(Deployment Config)
  • GPG
  • 開發者資訊(Developer Information)
  • 來源程式碼管理(SCM)
  • 版權宣告(Licenses)
  • 範例POM檔

Sign maven central repository

註冊Namespace

請務必以github進行登錄,這樣就可以有免費的namespace可以用

原文
If you do not see this pop-up AND you signed up with GitHub, then Sonatype was able to grant you permissions to the namespace associated with your GitHub identity automatically. As part of your GHubiated with your GitHub identity automatically. As part of your GHubHub subscription GitHubwion sutomatically. As part that reflects your username and allows you to publish GitHub Pages under that domain. Because of this, Sonatype can, in most cases, automatically verify and provision publishing access to a namespace that looks likematically verify and provision publishing access to a namespace that looks like like like like like like ..

Deployment config

找到namespace

Java開源開發者指南:構建並部署到Maven Central
Java開源開發者指南:構建並部署到Maven Central

務必確保資料一致

io.github.internetms52 object-pool 0.1.3 object-pool jar https://github.com/internetms52/object-pool-maven-lib This is a library that implements an Object Pool, and it supports nested object creation as well as constructor specification.
登入後複製
Generate User Token

View Account > Generate User Token

完成後就會取得settings.xml所需的資訊

Java開源開發者指南:構建並部署到Maven Central

指定server(settings.xml)

   central XXXXXX YYYYYY   
登入後複製
指定maven central repository server設定(pom.xml)

 org.sonatype.central central-publishing-maven-plugin 0.5.0 true  central  
登入後複製
Java doc

使用Maven Plugin產生Java Doc

 org.apache.maven.plugins maven-javadoc-plugin 3.2.0   attach-javadocs  jar    
登入後複製
GPG

產生GPG Key Pair

sudo apt-get install gnupg gpg --full-generate-key gpg --list-keys
登入後複製
GPG簽名plugin

 org.apache.maven.plugins maven-gpg-plugin 3.0.1   sign-artifacts verify  sign    --pinentry-mode loopback     
登入後複製
上傳GPG公鑰

GPG的公鑰server有兩個比較有名的

    pgp.mit.edu
  • keyserver.ubuntu.com
gpg --keyserver hkp://pgp.mit.edu --send-keys F1BD06AB06C36BD5EB53B6E8710DEC40549547D2 gpg: sending key 710DEC40549547D2 to hkp://pgp.mit.edu gpg --keyserver hkp://keyserver.ubuntu.com --send-keys F1BD06AB06C36BD5EB53B6E8710DEC40549547D2 gpg: sending key 710DEC40549547D2 to hkp://keyserver.ubuntu.com
登入後複製
Developer info

  LU.YU HSIN yourmail@mail.com internetms52 https://github.com/internetms52/object-pool-maven-lib  
登入後複製
SCM

 scm:git:git@github.com:internetms52/object-pool-maven-lib.git scm:git:git@github.com:internetms52/object-pool-maven-lib.git https://github.com/internetms52/object-pool-maven-lib 
登入後複製
Licenses

  Apache License, Version 2.0 http://www.apache.org/licenses/LICENSE-2.0.txt repo  
登入後複製
範例 POM

object-pool-maven-lib

以上是Java開源開發者指南:構建並部署到Maven Central的詳細內容。更多資訊請關注PHP中文網其他相關文章!

來源:dev.to
本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板
關於我們 免責聲明 Sitemap
PHP中文網:公益線上PHP培訓,幫助PHP學習者快速成長!