Skip to content
Claudio C. edited this page Jun 18, 2025 · 32 revisions

How to publish a release of LibrePDF/OpenPDF to Maven Central

First you need to have an account @sonatype to be able to publish artifacts to Maven Central. See the Pre-Requisites.

Creating a new release

Update the version and tag the release

Note that all version number changes should follow Semantic Versioning 2.0.0.

<version> represents the version that is to be released.

<next-version> represents the placeholder version until next release.

Also note, that all changes here are only local.

  1. Update all the pom.xml files to remove -SNAPSHOT from the version. For example, if our current version is 1.0.0-SNAPSHOT then <version> is 1.0.0.
mvn versions:set -DnewVersion=<version>
  1. Edit README.md to reflect this new version change.

  2. If you want, create a change log in the /changelogs/ directory, or let GitHub do this for you (when you create a new release in GitHub).

  3. Commit your changes, then add a tag with the new version number.

git commit -a
git tag <version>

Publish the release

Assuming you have the repository installed and you're able to build it successfully, there are only two more steps.

First, make a staging release

mvn clean deploy -Prelease

If this runs without errors, go to https://central.sonatype.com/publishing/deployments to review the staging release (you will need to login with your JIRA/Sonatype account). If everything looks good, you can publish the release directly from there.

Congrats! If you made it through this step, then you've successfully published a release of OpenPDF!

Error Handling

If any errors occur, you can see them also on central. In that case you can drop the release and fix the errors. Commit the fixes and try again. If you created a tag before, you need to recreate it:

git tag -d <version>
git tag <version>

Wrap up: update to the new working version

Finally, update all the pom.xml files once again and increment the version number (with -SNAPSHOT). For example, if <version> is 1.0.0 then <next-version> could be 1.0.1-SNAPSHOT.

  1. Set the next working Version:
mvn versions:set -DnewVersion=<next-version>
  1. Commit and push these changes
git commit -a
git push
git push origin --tags
  1. Publish the new release in github: https://github.com/LibrePDF/OpenPDF/releases
Clone this wiki locally