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

How to become a DevOps Engineer — The Hard Way

How to update a forked repo

DevEx Governance Meeting # 46 dated 09.09.2021

Why Does Everybody Want to Use Kubernetes?

Do you need to use xargs?

3 Mistakes You’re Probably Making When Unit Testing

What would SQLite would look like if written in Rust? — Part 0

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

First Step for Logging with Log4J2

Are You Unclear about Spring Boot Initializer? Check Below!

Spring Boot with Jooq and Liquibase

Different calling forms of REST services with Feign client in Spring Cloud