-
Notifications
You must be signed in to change notification settings - Fork 25
Publishing to Maven Central
-
Install GNU PG.
-
Import our secret key into your keychain.
-
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>
-
In the above file set your username and password for https://issues.sonatype.org/
-
In the above file set the
gpg.passphrase
with ours.
If there are changes to commit or the version in pom.xml
yet has to be bumped.
- Unless you are already on a different branch then the secured
master
, checkout a newpublish/[version]
branch:git checkout -b publish/[version]
. - Bump the
<version>[version]</version>
inpom.xml
. - Add and commit all changes:
git add . && git commit -am "[version]"
. - Tag the release with the same version:
git tag [version]
. - Push:
git push --set-upstream origin publish/[version]
- Create a PR to merge the branch to
master
.
Else:
- Create a tag and/or release with the same version as in
pom.xml
.
Then:
Follow this part if you want to build and release this project on your own computer.
- Run:
mvn clean package deploy
(ormvn deploy
if you already ranmvn clean package install
earlier) - Go to: https://oss.sonatype.org/#stagingRepositories
- On the right search for
thethingsnetwork
- Wait for
orgthethingsnetwork
to appear. - Select the result and select
Close
from the menu above it. - Refresh until you see it has been processed.
- Select the result and select
Release
from the menu above it (Automatically drop indeed). - Verify the release at: https://oss.sonatype.org/#nexus-search;quick~TheThingsNetwork
- Tweet about it! 🎉
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 !
- This kind off follows https://dzone.com/articles/publish-your-artifacts-to-maven-central
- Our JIRA ticket: https://issues.sonatype.org/browse/OSSRH-25140