Sonatype Delivers Premium Open Source Controls to GitHub | Press Release

blog-logo Sonatype Blog

CircleCI Maven Release Orb

November 26, 2019 By Dan Rollo

TLDR: Here’s the Orb.

What’s in a title? Let’s break this title apart to clarify what we’re talking about...

CircleCI

What is CircleCI? CircleCI is a cloud based continuous integration service. It runs your builds and unit tests with all sorts to combinations of OS. I should also mention it is free! You can run “local” builds that are very similar to the build CircleCI would run in the cloud. This is very useful for debugging the build configuration. The Sonatype Community uses CircleCI to run builds and releases of many projects in the community.

Orb

What is an Orb? CircleCI builds are configured using the .yml format. An Orb is a way to share and reuse chunks of this .yml configuration format across projects. I think of an Orb as the CircleCI equivalent of a plugin. CircleCI maintains a registry of Orbs that makes it very easy to share an Orb.

Maven Release

This part needs a bit more introduction. While setting up CI builds for the Sonatype Community, we found a very useful Orb that simplified building and testing maven projects. (Thanks to Benny for writing and sharing this orb!)

We wanted a slightly different behavior when it comes time to deploy our maven projects to the Maven Central repository. It turns out the maven-release-plugin already provides the behavior we wanted. Specifically, to increment the development version of a project to a new “release” version, and then also increment that project version to the “next development” version (which will have a “-SNAPSHOT” suffix). All these changes are banked and pushed to GitHub by the maven-release-plugin.

So, I created a new Orb (based on the existing work of freelance technical architect Benny Bottema - thanks again Benny!) which executes the maven-release-plugin to perform a release and handle all the details (increment release version, publish release on Maven Central, increment next development version, push changes to GitHub, and more).

For more details on how to use this Orb, please see resources below:

Demo Video

To learn more, you can access our CircleCI Maven Release Orb documentation or head over to the Sonatype Exchange to check out all of our open source plugins and join the community!

Tags: Apache Maven, central maven repository, Product, Post developers/devops, CircleCI, Orb

Written by Dan Rollo

Dan is a developer, learning more languages than he ever thought possible. He moves as slowly as he can, and rarely gets it right the first time. When he is done with a project, he really understands what he did, for at least one full week.