Releasing OS-specific GraalVM native image binaries easier with JReleaser

Posted on
til java graalvm dev

Packaging and releasing Java applications (e.g. CLI) tend to be cumbersome, and the user-experience tended not to be the best as users have to download a valid version of JRE, etc.

JReleaser is an awesome tool that takes most of the heavy-lifting — including, but not limited, to packaging, distribution, notifications, etc. — and let you focus on your application details.

Today, I found a great example of how to use JReleaser and mixing it with GraalVM to package native-image applications and releasing them on GitHub: — which I haven’t used in anger just yet.

Some considerations when using Maven — but probably usable generally:

I managed to take this inputs and apply it for a simple CLI to list Kafka topics with additional metadata:

Hope to share more details about building GraalVM images in another post.

At the moment JReleaser seems to be focused on applications (e.g. CLI, executable JARs, etc.). If you are looking to publish a Java library, probably is enough using mvn deploy command — though JReleaser could be complementary.