How to Publish Open Source Java Libraries to Maven Central

Sonatype OSS Project Setup

Generate a PGP Key Pair

Gradle Build

  • produce JavaDoc and sources Jar files along the main library Jar file
  • sign artifacts using your private PGP key
  • configure the publishing task and set up your POM
  • upload signed Jar files to the staging repository

Apply required plugins to your build.gradle.kts file

Define Gradle tasks to build Sources and JavaDoc jar files

Set up Maven publications and your project’s POM

Configure Artifact Signing

GitHub Actions: Continuous Integration Pipeline

Releasing to Maven Central

--

--

--

Lead Architect at LiquidShare, building a cloud native, blockchain enabled, financial services SaaS platform.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

PHP — the Most Disliked Programming Language that Still Works!

Kubernetes for Everyone

7 Days of Learning Vim

How to Fix Winres.exe on Windows 10?

Application Transformer for VMware Tanzu on VMC on AWS

What is API Testing?

How to Transition to Product Management as a Developer by Stash PM

CS371p Fall 2020: Giahuy Nguyen

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Emil Kirschner

Emil Kirschner

Lead Architect at LiquidShare, building a cloud native, blockchain enabled, financial services SaaS platform.

More from Medium

Garbage Collection in Java

import Json dependency in JAVA

import — Java Package Does Not Exist Error

How to compare two JSON objects in Java tests and when the order of values is not important