发布自己的jar到maven中央仓库

本文介绍如何使用 Sonatype 的 OSS Repository Hosting (OSSRH) 发布开源项目的二进制文件。涵盖创建 JIRA 账户、申请权限、满足组件要求等内容,并提供部署及发布到中央仓库的具体步骤。
摘要由CSDN通过智能技术生成

 

参考我自己的实例

https://issues.sonatype.org/browse/OSSRH-36402

官方指引 https://central.sonatype.org/pages/ossrh-guide.html

下面是官方指引的内容

OSSRH Guide

Introduction

Sonatype OSSRH (OSS Repository Hosting) uses Sonatype Nexus Repository Manager to provide repository hosting service for open source project binaries - be sure to review the full terms of service. OSSRH uses the Maven repository format and allows you to:

  • deploy development version binaries (snapshots)
  • stage release binaries
  • promote release binaries and sync them to the Central Repository

The initial setup for your OSSRH repository requires some manual steps and human review (see why), after which your deployment process is typically modified to get components into OSSRH. These are all one time steps.

After the initial setup, publishing from OSSRH to Central is a trivial action which can be done via a browser or programmatically.

Initial Setup

Create a ticket with Sonatype

Sonatype uses JIRA to manage requests.

  1. Create your JIRA account
  2. Create a New Project ticket

This triggers creation of your repositories. Normally, the process takes less than 2 business days. Why the wait?

Helpful videos:

Please do not deploy until after you have received an e-mail notice indicating that the ticket is Resolved. One of the most common problems related to new projects is premature deployment, which misroutes your artifacts to a catch-all repository.

Lastly, if your component is already in Central be sure to note this in your ticket, and review how to migrate to OSSRH.

Review Requirements

There are basic metadata and content requirements for components available in Central. We recommend getting familiar with them while your repositories are being created. For the details, see Central Component Requirements.

Helpful videos:

Deployment

Most developers find it easiest to implement a deployment procedure in order to automatically meet the component requirements. Depending on your choice of tools and approach there are many different do this.

Below is information for popular tools and approaches. Feel free to send notes about alternative approaches or corrections.

Note: There is a limit of roughly 1024MB on any single file uploaded to OSSRH. Your uploads will fail with a broken pipe exception when you hit this limit. Contact us directly if you need to upload larger components.

Helpful videos:

Releasing to Central

At this point, your project is deployed to private repository only accessible to your project members.

To release your components, you can either release them directly from the command line, if you are using the Nexus Staging Maven Plugin or Ant Tasks or open your favorite browser and go to https://oss.sonatype.org/ or follow our detailed instructions.

Helpful videos:

Upon release, your component will be published to Central: this typically occurs within 10 minutes, though updates to search can take up to two hours.

OSSRH Usage Notes

Accessing Repositories

The following repositories allow you to access your components in OSSRH directly. Users will simply get your components directly via the Central Repository, but for committers and other collaborators on your project this list might be useful.

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值