How to Publish Artifacts on Maven Central

Domenico Sibilio
Geek Culture
Published in
5 min readJan 14, 2021

--

https://search.maven.org/

Publishing your first artifact on Maven Central can be as exciting as it can be confusing. We’ll see together how to make your first time as smooth as it should be, while also making sure people can easily contribute to your Open Source Java libraries. At last, we’ll see how to craft a Maven Central-ready CI/CD pipeline via GitHub Actions.

Introduction

Uploading your Java code to Maven Central is an important step towards actively contributing to the Java Open Source community, and it, therefore, mandates you follow a series of quite strict requirements.

Let’s go over each one of these requirements and streamline the process, shall we?

P.S. you can refer to one of the projects I published on Maven Central as a reference in case any doubts arise: https://github.com/dsibilio/badge-maker

Informative POM

The first thing to do is making sure that your groupId matches a domain that you own, or alternatively the domain that is used for sharing your Open Source project.

Assuming I’d own the dsibilio.com domain (which I don’t), and I’d be hosting my project over at GitHub, the following would both be valid groupIds:

  • com.dsibilio
  • io.github.dsibilio

--

--