Last week, I needed to push some tiny little open source projects of mine to Maven Central. I’d been avoiding this because I figured it’d be a huge hassle. Turns out, no: it’s easy!

Pretty much everything you need to know is documented in detail here: The Central Repository: OSSRH Guide. In short, though, the process goes like this:

  1. File a ticket with the OSSRH project requesting a new repo.
    • The ticket I filed for this is OSSRH-22242, which they resolved in less than an hour! Wow.
  2. Update your POMs’ <distributionManagement /> section to point at your new OSSRH repos.
  3. Ensure that your projects sign their artifacts, using the maven-gpg-plugin.
    • With Ubuntu’s GPG keyring integration, I only have to enter my key’s password the first time in a login session.
  4. Tweak your POMs a bit to comply with Central’s very reasonable business rules.
    • If you mess this up, the repos will give you a very user-friendly error message explaining the problem.
    • My first try, I got an error, but just had to go back and add a <developers /> section to my POM. No problem.
  5. Optionally, you probably also want to start using nexus-staging-maven-plugin (instead of maven-deploy-plugin). It’s not required, but will make your life easier.
    • I tried to avoid this at first, myself. Decided to make the switch, though, because without this plugin I’d have to go in after each release and manually approve/promote the staged artifacts. Somewhat annoying, but happily the nexus-staging-maven-plugincan do that automagically for you.

My projects are organized such that they all inherit from a single parent POM, so that’s where I had to make all of the changes. Here’s a trimmed-down version of what I ended up with:

<project xmlns="" xmlns:xsi="" xsi:schemaLocation="">



    A parent POM for this library collection, which helps to standardize 
    the plugins, libraries, and build settings used in the various modules.
    <name>Karl M. Davis</name>
      <name>Apache License 2.0</name>

      <name>Karl M. Davis</name>

    <!-- Deploy these open source projects to the public OSSRH repositories, 
      per This helps ensure 
      that the releases land in the Maven Central repos. -->

    <!-- URL format taken from -->


            <!-- Ensure that all artifacts get signed prior to being deployed. 
              This is required for all artifacts heading to the Maven Central repo, but 
              is a good idea in general. -->
        <!-- Specifying this plugin here replaces the default deploy plugin in 
          the lifecycle: this plugin will be used to deploy artifacts. This is great 
          for interacting with OSSRH and deploying to Maven Central. However, it can 
          be disabled in descendant projects by setting 'extensions' to false. -->


You can find the full POM here on Maven Central: com.justdavis.karl.jessentials:jessentials-parent:5.0.0:pom.

Many thanks to Sonatype and anyone else involved in the OSSRH repos for making this so simple!