Skip to content

Tech: How to make a new JSON java release

Sean Leary edited this page Nov 15, 2020 · 37 revisions

JSON-Java releases are only for the purpose of checkpointing code changes for the public Maven repository. New releases do not require a fixed cadence. As long as the repository is relatively active, about every 4-6 months seems reasonable. Urgent fixes may require more frequent releases, but minor fixes and new features can wait. When you decide to release a new version, here are the steps to follow:

  • Decide on a commit checkpoint. Usually, this will be the latest commit.
  • Decide on a release label. We do not use semantic versioning for several reasons. Historical Maven releases have been by date, and changing the release label format could cause misordering in the Maven repository. The project is in maintenance mode - no design or major API changes are being accepted, so there is no need for major/minor or other release sequences. Instead, we use a simple date format: YYYYMMDD, which is the date of the release.
  • Update the README Release history section with the release number and title.
  • Update the pom.xml with your release version and push to remote repository: <version>20201115</version>
  • On GitHub, navigate to Releases > Draft a new release. Enter the release label. Choose the release branch. Usually, this will be the master branch. For the title, the release number will suffice. In the description, include a table in reverse chronological order of links to merged pull requests and 1-line descriptions. The top of the list should contain the latest pull request, and the bottom should contain the first pull request after the last release.

For more information about GitHub releases, see https://help.github.com/articles/creating-releases/

We also publish new releases to the Maven repository. The Maven JSON-Java project is hosted by Sonatype and published to the Maven Central repository.

First One time task to be done by the person responsible for Maven releases

  • Start here: https://central.sonatype.org/pages/ossrh-guide.html
  • Create an account to open a Jira case. This account will be the same one you will use to deploy new releases to Maven Central.
  • When claiming the org.json namespace, mention the current owner by sonatype username in the JIRA ticket, and send the owner an email with the ticket number. After the previous owner approves, they will handover the project.

Second One time task to be done by the person responsible for Maven releases

Create and upload gpg keys GitHub and a key server from the bash shell.
# create a new key, using name, comment, email, and passphrase
gpg --gen-key  
# look for the 'sec' line
gpg --list-secret-keys --keyid-format long 
# may not need this
git config user.signingkey (your secret key)
# get your public key
gpg --armor --export (your secret key)
# In GitHub, click your profile pic, select settings > ssh & gpg keys, add the entire public key including framing
# Get your public key hash (I think)
gpg --list-keys
# make sure your permissions are good
chmod 400 /(directory)/.gnupg/gpg.conf
chmod 600 /(directory)/.gnupg
$ gpg --keyserver keys.gnupg.net --send-keys (output from list-keys)
gpg: sending key (key) to hkp server keys.gnupg.net

**Third One time task to be done by the person responsible for Maven releases**
On your local machine, open a bash shell. 
Create ~/m2/settings.xml with these contents:

ossrh yourSonatypeUsername yourSonatypePassword


CD to the JSON-Java local repository

mvn clean deploy


If successful, your project will be deployed to maven central.

View the new release here:

[https://oss.sonatype.org](https://oss.sonatype.org)

Search for group: org.json artifact: json
You need to do one more action: Release. Bring up your project, the release button will be at top of page,
just click and wait about 10 minutes.

Reference: https://github.com/BGehrels/JSON-java
Clone this wiki locally