JReleaser 0.2.0 has been released!

With just two weeks since its first release, JReleaser has posted its second release: 0.2.0 is here! This version is an overhaul of the whole tool across the board, as shown by the list of issues associated with the v0.2.0 milestone. There you'll find bug fixes, small features, and big features, some of them which will be described in the following paragraphs.

Auto Config Releases

The original idea behind JReleaser is to publish Java binaries via several distribution channels, such as Homebrew, Snap, Scoop, etc. These distribution channels typically require downloading artifacts from a Git release page, which is why JReleaser can create or update a Git release for you. JReleaser implements these features as a series of steps that can be invoked as a whole (the full-release command) or separately from one another. What if you just wanted to create a Git release? What if you were to skip the model altogether and define only those properties that JReleaser can't infer? Well this is exactly what the --auto-config flag lets you do when you invoke the release command from the CLI. The JReleaser guide includes an example of this feature.

Single JAR Distributions

It's quite common to find Java applications be packaged as a JAR that contains all of its dependencies inside. This is know as a "fatjar" or "uberjar" archive. There are many ways to create such JARs, typically using the Maven shade plugin, or the Gradle shadow plugin. Starting with version 0.2.0 JReleaser can handle this kind of distributions.

Native Image Distributions

Native Image distributions are comprised of Java code that has been compiled to platform specific code using GraalVM's Native Image utility. Though the resulting binary is no longer Java bytecode it can trace its origins to Java thus JReleaser supports this kind of distribution as well.

Cross Platform Jlink Java Runtimes

Support for custom Java Runtimes created using Jlink was added since the first release, however this release gives us the option to create several Jlink Java Runtimes from the same source while targeting different platforms. That's right, you may assemble Jlink Java Runtimes for Linux, OSX, Windows (or any other platform supported by your Java vendor of choice) from a single platform. You bet we have an example for this case.

More Announcers

Another aspect that JReleaser can do for you is to announce a release via different channels. This version includes Gitter, Microsoft Teams, Discord, and Slack via webhooks.

Tracing and Outputs

Several values related to the project will be calculated and resolved by JReleaser. Depending on your setup you might want to read those values and trigger other aspects during a build pipeline execution. These values can be found in the ${build}/jreleaser/output.properties file. Here's for example the outputs created when JReleaser released itself as 0.2.0

#JReleaser 0.2.0-SNAPSHOT
#Sat Apr 24 08:41:32 UTC 2021
commitFullHash=f1b329719a25fab9fff59e952a58d541df44cb4f
commitShortHash=f1b3297
javaVersion=11.0.11
milestoneName=0.2.0
projectName=jreleaser
projectSnapshot=false
projectVersion=0.2.0
projectVersionMajor=0
projectVersionMinor=2
projectVersionPatch=0
releaseName=Release v0.2.0
tagName=v0.2.0
timestamp=2021-04-24T08\:39\:34.727715Z

Additionally, every invocation of JReleaser will write down a full log at ${build}/jreleaser/trace.log allowing you to investigate a release failure without having to re-run the release again.

Stable Prerelease and Release Configuration

The same configuration can be used for both prerelease and release invocations. Configuration elements that are sensitive to the project's snapshot status can now be configured to trigger under the following circumstances:

  • NEVER. As the name implies, they'll never trigger.
  • ALWAYS: They'll trigger every time.
  • RELEASE: They'll trigger only when the project is NOT a snapshot.
  • SNAPSHOT: they'll trigger when the project is a snapshot.

JReleaser uses this feature to publish both prerelease and release using a single configuration file, as explained here.

Be mindful of the breaking changes introduced in this release. As always, feedback is welcomed, feel free to file a ticket or start a discussion topic.

Keep on coding!

Image by Samuel F. Johanns from Pixabay

Liked it? Take a second to support aalmiray on Patreon!
Become a patron at Patreon!

Trackbacks/Pingbacks

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

ˆ Back To Top