Apache Ant

Your Ant build must be configured to create binary distributions (Zips and Tars). Review the Ant documentation to find out how to do that. Follow the instructions in the Apache Ant section of the Install page to download and install the JReleaser Ant tasks. Once configured you can bootstrap a configuration file

$ ant jreleaser-init -Djreleaser.format=yml
Buildfile: /Home/duke/app/build.xml

jreleaser-init:
Writing file /Home/duke/app/jreleaser.yml
JReleaser initialized at /Home/duke/app

BUILD SUCCESSFUL
Total time: 0 seconds
JReleaser supports the following formats: yml, toml, json.

This generates a jreleaser.yml file with the following configuration

jreleaser.yml
project:
  name: app
  version: 1.0.0-SNAPSHOT
  description: Awesome App
  longDescription: Awesome App
  authors:
    - Duke
  license: Apache-2
  links:
    homepage: https://acme.com/app
  java:
    groupId: com.acme
    version: 8
  inceptionYear: 2021

release:
  github:
    owner: duke

distributions:
  app:
    artifacts:
      - path: path/to/{{distributionName}}-{{projectVersion}}.zip

Edit the file to suite your needs. You may use the Archive assembler to create a binary distribution, or any other existing Ant tasks you may already have to create such files. Once you have edited the file you may verify its configuration by invoking

$ ant jreleaser-config

At any time you may invoke any of the other commands, but when it’s time to make a release you have to invoke

$ ant jreleaser-full-release
Buildfile: /Home/duke/app/build.xml

jreleaser-full-release:
[INFO]  JReleaser 1.16.0-SNAPSHOT
[INFO]  Configuring with jreleaser.yml
[INFO]   - basedir set to /Home/duke/app
[INFO]  Reading configuration
[INFO]  git-root-search set to false
[INFO]  Loading properties from /Home/duke/.jreleaser/config.properties
[INFO]  Validating configuration
[INFO]  Strict mode set to false
[INFO]  Project version set to 1.0.0
[INFO]  Release is not snapshot
[INFO]  Timestamp is 2021-03-28T12:25:16.219+02:00
[INFO]  HEAD is at c3e39f1
[INFO]  Platform is osx-x86_64
[INFO]  dryrun set to false
[INFO]  Generating changelog: out/jreleaser/release/CHANGELOG.md
[INFO]  Calculating checksums
[INFO]    [checksum] target/distributions/app/app-1.0.0.zip
[INFO]  Cataloging artifacts
[INFO]    [sbom] Cataloging is not enabled. Skipping
[INFO]  Signing files
[INFO]    [sign] Signing is not enabled. Skipping
[INFO]  Deploying Maven artifacts
[INFO]    [maven] Deploying is not enabled. Skipping
[INFO]  Uploading distributions and files
[INFO]    [upload] Uploading is not enabled. Skipping
[INFO]  Releasing to https://github.com/duke/app
[INFO]   - Uploading app-1.0.0.zip
[INFO]   - Uploading checksums.txt
[INFO]  Preparing distributions
[INFO]    - Preparing app distribution
[INFO]  Packaging distributions
[INFO]    - Packaging app distribution
[INFO]  Publishing distributions
[INFO]    - Publishing app distribution
[INFO]  Announcing release
[INFO]    [announce] Announcing is not enabled. Skipping
[INFO]  Writing output properties to out/jreleaser/output.properties
[INFO]  JReleaser succeeded after 0.894s

BUILD SUCCESSFUL
Total time: 4 seconds

This command performs the following actions:

  • checksums all artifacts.

  • signs all files (if signing is enabled).

  • creates a release at the chosen Git repository.

  • prepares, packages, and uploads configured packagers (brew, jbang, etc).

  • announces the release.

JReleaser generates 2 files after most commands are run. These are output.properties and trace.log. The first contains a set of calculated values such as the project version, tag, timestamp, and more. The second contains the full execution log plus any stacktraces in case of errors. You’ll find these files inside out/jreleaser.

Next Steps