How JRebirth deploys to JCenter and Maven Central

This post will describe briefly how we are managing the release of all JRebirth artifacts by using Maven Build, Jenkins, Artifactory, Bintray/JCenter and Nexus.


All JRebirth artifacts are deployed to several repositories as explained into the official documentation page : Installation

As you probably know, JRebirth is built using Maven tool, really convenient to package binaries, javadoc and sources jar but also to make and deploy the jrebirth website with syntax highlighting (thx to doxia include macro). It allows to break the build if a piece of code used into documentation is missing (ie: after some refactoring changes).

Repository Strategy

JRebirth is pushed by our Continuous Integration Server on several repositories to be available everywhere. (it uses a parameterized build that let to choose a git tag to build and Maven profiles used)

    • (Local Artifactory)
    • (OSS Artifactory)
    • –> JCenter –> –> Maven Central

 Maven profiles

To select the target repository, I have defined a parameterized section for distribution management into the JRebirth Organization ‘super’ parent pom.


And then I created 3 profiles that can be activated to choose the right target repository

<!-- Open Source Artifactory --><profile>
		<!-- Release repository -->
		<!-- Snapshot repository -->

<!-- JCenter repository for release and central sync -->
		<!-- Release repository -->
		<!-- Snapshot repository -->

<!-- Private repository for own tests & development -->
		<!-- Release repository -->
		<repositoryName>JRebirth Releases Repository</repositoryName>
		<!-- Snapshot repository -->
		<snapshotRepositoryName>JRebirth Snasphots Repository</snapshotRepositoryName>


The Organization Pom is pushed to jrebirth/JRebirth/Organization bintray’s package (bintray’s organization / Bintray’s repository / Bintray’s Package); but the JRebirth AF is pushed to  jrebirth/JRebirth/JRebirthAF, so I have overriden this part into JRebirthAF parent pom:

	<!-- Override Bintray profile to use another Bintray Package -->
			<!-- Release repository -->
			<!-- Snapshot repository -->

Push to Bintray

Now we can call: maven clean deploy -P Bintray,GPG to push artifacts to Bintray, when the build has succeeded open your Bintray Package, you will see a notice message indicating that some items can be added to this package.

BintrayJust accept them by clicking on Publish, and you can use the File tab pane tocheck that all files are OK.


A this point, your binaries are available within Bintray !!!

You shall ask to Bintray support to permanently sync your package into JCenter, this should be done only once and will take some hours to let them verify your owner rights on binaries published.

JCenterWhen they accept this automatic synchronization, your binaries will be automatically available on JCenter, also for future files

But what is JCenter ? In few words, it’s the best alternative to Maven Central, because it’s a superset of it !

According to bintray’s web site:

JCenter is the place to find and share popular Apache Maven packages for use by Maven, Gradle, Ivy, SBT, etc.
For the most comprehensive collection of artifacts, point your Maven at:
Want to distribute your own packages through JCenter? You can link your package by clicking the “Include My Package” button.
And if you’re into legacy, you can even synchronize your packages directly to Maven Central.

You can find more information here :

Legacy Sync !

Let’s send our binaries to Maven Central, the largest ‘legacy’ repository for java binaries, use the right tab pane.
Then use your login/password asked on sonatype’s JIRA. ( and click Sync button.

Bintray3Wait a moment and carefully read the Sync Status message, if there isn’t any error you can jump to next step.


Release on Central

Previous steps only send all files to staging area into repository, the antechamber of Maven Central. So you have to perform some other steps to really release them.

Tip (Thanks to jbaruch for the reminder):

All these steps could be skipped if you check the item “Close and release repository when done”. But the first time you should perform it manually to check what goes wrong (even if errors are displayed within Bintray page). You can also modify staged files, in example to remove some files.


Log in to Sonatype repo, and open staging repositories page.
Find the repository created by the Bintray synchronization (for us it was orgjrebirth-1014) and close it !

CentralA confirmation popup will be displayed, just validate it and check the close logs.

Central2Then release the staged repository

Central3Again check the release logs, first time there are often error like missing GPG signature or missing javadoc or source jars (you can browse JRebirth pom to find how it was configured). You can also refer to the sonatype how-to web page to fix these errors.

Before 8.0.2 I had to remove all showcases modules because validation of Maven submodules was failing due to an old Maven issue, fortunately it was fixed and no more manual steps are required.


Great ! your repository is now released, you can drop it and wait some hours to see your files available into Maven Central.





Leave a Reply