JTransc: First sonatype release

Feb 10 2016

I have finally created a non-snapshot version of jtransc. First release version is 0.0.1.

You can find it here

Uploading releases to sonatype requires several steps.

And I’m going to document them so other people can benefit from what I have learned in that time-consuming process.

Creating user

First of all you have to create an user in sonatype jira

Requesting groupId

Then you have to create an issue requesting permissions for your groupId. As reference, for JTransc I created this issue OSSRH-18584

You can buy a domain with the reversed order domain of your group id, or you can use github or similar as base. You can find a guideline for this here.

Configuring pom.xml

In order to publish to sonatype, you need to add their repositories to the distributionManagement section.


In order to be able to download dependencies from there:

        <name>Sonatype OSS Snapshot Repository</name>

Configuring servers

You will have to edit $user/.m2/settings.xml in order to configure your user/password from sonatype. You can use plain password or user tokens that you can grab from Sonatype Nexus Repo.

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"

Publishing snapshots

After validated, you will be able to use mvn deploy to upload snapshots.

Publishing release builds

Publishing releases requires some more work.

You first need to upload to sonatype-staging, just using a non-snapshot version with the configuration above and mvn deploy will do the job.

In order to promote a release version from staging you have to ensure your project meets some requirements: extra pom sections, sign with pgp, include -sources and -javadoc packages.

You can find a guide for these requirements, here.

Extra sections in pom.xml

You must ensure that your pom.xml has at least these sections:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <name>Example Application</name>
  <description>A application used as an example on how to set up pushing
  its components to the Central Repository.</description>
      <name>The Apache License, Version 2.0</name>
      <name>Manfred Moser</name>

sign with pgp

In my case never used PGP. In OSX you must install it brew gpg.

gpg --gen-key

Your key must be RSA 2048-bit

gpg --armor --export alice@cyb.org
Version: GnuPG v0.9.7 (GNU/Linux)
Comment: For info see http://www.gnupg.org

You will have to upload the public key block to one public server. Mine was: http://keyserver.ubuntu.com:11371/pks/add

In your pom.xml you will have to add:


It will request your password while performing mvn deploy.

To avoid having to type your password everytime, you can:

mvn clean deploy -Dgpg.passphrase=yourpassphrase

Though this will put your password in .bash-history and similar files.

including -sources and -javadoc packages

In my case, with kotlin I have the following plugins:


releasing staged artifacts

You can see jtransc pom.xml file.

You have to go to sonatype nexus: https://oss.sonatype.org/

At the sidebar: Sonatype (TM) -> Build Promotion -> Staging RepositoriesAfter the mvn deploy you will be able to see there your release. You have to select it, and check at the bottom file viewer if it’s all ok. In the activity tab you will be able to see if there were problems validating your release (all the requirements I put above).

Then you have to select your release, and press the close button above.

After that, your release will be closed, and you will be able to press the release button.

In the case you did something wrong, you should press the drop button instead.