Skip to content

Release with bintray

Tadaya Tsuyukubo edited this page Jul 13, 2014 · 2 revisions

Use bintray to sync to maven central

Release Setup

Bintray Setup

register Sonatype username (onetime)

goto Edit Profile => “Accounts” => “Sonatype OSS User"

Add GPG Signing (onetime)

Reference here for PGP install

Edit Profile => "GPG Signing""

To get ascii armored gpg private/public keys:

  • Ascii Armored Public Key
> gpg -a --export [email protected]
  • Ascii Armored Private Key
> gpg -a --export-secret-key [email protected]

Link repository to jcenter (onetime)

goto https://bintray.com/bintray/jcenter (link on bin tray home page) => “Include My Package"

Project Setup

pom.xml

add "distributionManagement" to pom.xml

  <distributionManagement>
    <repository>
      <id>bintray</id>
      <url>https://api.bintray.com/maven/[MY_BINTRAY_USERNAME]/maven/[ARTIFACT_NAME]</url>
    </repository>
  </distributionManagement>

settings.xml

  <server>
    <id>bintray</id>
    <username>[MY_BINTRAY_USERNAME]</username>
    <password>[MY_API_KEY]</password>
  </server>
  • MY_BINTRAY_USERNAME, MY_API_KEY can be found on Profile Edit => API Key
  • id in server.xml and pom.xml need to match

Release

Upload artifact to bintray

Publish uploaded artifact

Sign artifacts via REST API

curl -u [BINTRAY_USERNAME]:[BINTRAY_API_KEY] -X POST  -H "Content-Type: application/json" https://api.bintray.com/gpg/[BINTRAY_USERNAME]/maven/[ARTIFACT_NAME]/versions/[VERSION] -d '{
"passphrase": "[GPG_PASS_PHRASE]"
}
'

Sync artifacts to maven central

  • goto project page on bintray => click “Maven Central” tab => enter sonatype pass