Skip to content
This repository has been archived by the owner on Oct 21, 2020. It is now read-only.

Publishing to Maven Central

Romain Cambier edited this page Dec 16, 2016 · 8 revisions

One Time

  1. Install GNU PG.

  2. Import our secret key into your keychain.

  3. Create ~/.m2/settings.xml with:

    <?xml version="1.0" encoding="UTF-8"?>
    <!--
       User-specific configuration for maven. Includes things that should not 
       be distributed with the pom.xml file, such as developer identity, along with 
       local settings, like proxy information. The default location for the
       settings file is ~/.m2/settings.xml 
    -->
    <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
       <servers>
           <server>
               <id>ossrh</id>
               <username>fokkezb</username>
               <password>XXX</password>
           </server>
       </servers>
       <profiles>
           <profile>
               <id>ossrh</id>
               <activation>
                   <activeByDefault>true</activeByDefault>
               </activation>
               <properties>
                   <gpg.executable>gpg2</gpg.executable>
                   <gpg.keyname>E4536054</gpg.keyname>
                   <gpg.passphrase>XXX</gpg.passphrase>
               </properties>
           </profile>
       </profiles>
    </settings>
  4. In the above file set your username and password for https://issues.sonatype.org/

  5. In the above file set the gpg.passphrase with ours.

Release

If there are changes to commit or the version in pom.xml yet has to be bumped.

  1. Unless you are already on a different branch then the secured master, checkout a new publish/[version] branch: git checkout -b publish/[version].
  2. Bump the <version>[version]</version> in pom.xml.
  3. Add and commit all changes: git add . && git commit -am "[version]".
  4. Tag the release with the same version: git tag [version].
  5. Push: git push --set-upstream origin publish/[version]
  6. Create a PR to merge the branch to master.

Else:

  1. Create a tag and/or release with the same version as in pom.xml.

Then:

Manual release

Follow this part if you want to build and release this project on your own computer.

  1. Run: mvn clean package deploy (or mvn deploy if you already ran mvn clean package install earlier)
  2. Go to: https://oss.sonatype.org/#stagingRepositories
  3. On the right search for thethingsnetwork
  4. Wait for orgthethingsnetwork to appear.
  5. Select the result and select Close from the menu above it.
  6. Refresh until you see it has been processed.
  7. Select the result and select Release from the menu above it (Automatically drop indeed).
  8. Verify the release at: https://oss.sonatype.org/#nexus-search;quick~TheThingsNetwork
  9. Tweet about it! 🎉

Release using Travis-CI

This is the easiest way to release this project!

Each time a commit will occur on the master branch, a Travis build will trigger an automatic deployment of all artifacts referenced in the main pom.xml.

If the build is successful, you can just fall back to step 2 of the manual release, except than the artifact will already be close and checked: ready for release !

Notes

Clone this wiki locally