JReleaser CLI

Executes a JReleaser workflow as a command-line interface (CLI).

$ jreleaser -h
Usage: jreleaser [-hV] [COMMAND]
jreleaser
  -h, --help      Show this help message and exit.
  -V, --version   Print version information and exit.
Commands:
  init          Create a jreleaser config file.
  config        Display current configuration.
  template      Generate a tool/announcer template.
  assemble      Assemble distributions.
  changelog     Calculate the changelog.
  checksum      Calculate checksums.
  sign          Sign release artifacts.
  upload        Upload all artifacts.
  release       Create or update a release.
  prepare       Prepare all distributions.
  package       Package all distributions.
  publish       Publish all distributions.
  announce      Announce a release.
  full-release  Perform a full release.

Environment Variables

The following settings may also be specified via environment variables

Setting

Environment Variable

Default

output-directory

JRELEASER_OUTPUT_DIRECTORY

out

JRELEASER_DEFAULT_GIT_REMOTE

origin

Install

  • Windows

  • Linux

  • Mac

sdkman

sdk install jreleaser

manually

Download the pre-compiled binary from the releases page, uncompress and copy to the desired location.

sdkman

sdk install jreleaser

manually

Download the pre-compiled binary from the releases page, uncompress and copy to the desired location.

homebrew tap

brew install jreleaser/tap/jreleaser

sdkman

sdk install jreleaser

manually

Download the pre-compiled binary from the releases page, uncompress and copy to the desired location.

Configuration

JReleaser must be configured using the YAML, TOML, or JSON DSLs shown at Configuration.

Commands

The following commands are supported:

init

$ jreleaser init -h
Usage: jreleaser init [-dhioqVw] [-b=<basedir>] [-f=<format>] [-od=<outputdir>]
Create a jreleaser config file.
  -b, --basedir=<basedir>   Base directory.
  -d, --debug               Set log level to debug.
  -f, --format=<format>     Configuration file format.
  -h, --help                Show this help message and exit.
  -i, --info                Set log level to info.
  -o, --overwrite           Overwrite existing files.
      -od, --output-directory=<outputdir>
                            Output directory.
  -q, --quiet               Log errors only.
  -V, --version             Print version information and exit.
  -w, --warn                Set log level to warn.

Currently supported formats are: yml, json.

The file will be generated at <basedir> if specified, otherwise at the current directory.

config

$ jreleaser config -h
Usage: jreleaser config [-adfhiqVw] [-grs] [-scp] [-b=<basedir>]
                        [-c=<configFile>] [-od=<outputdir>] [-p=<key=value>]...
                        [-sp=<platform>]...
Display current configuration.
  -a, --assembly            Display assembly configuration.
  -b, --basedir=<basedir>   Base directory.
  -c, --config-file=<configFile>
                            The config file
  -d, --debug               Set log level to debug.
  -f, --full                Display full configuration.
      -grs, --git-root-search
                            Searches for the Git root.
  -h, --help                Show this help message and exit.
  -i, --info                Set log level to info.
      -od, --output-directory=<outputdir>
                            Output directory.
  -p, --set-property=<key=value>
                            Sets the value of a property. Repeatable.
  -q, --quiet               Log errors only.
      -scp, --select-current-platform
                            Activates paths matching the current platform.
      -sp, --select-platform=<platform>
                            Activates paths matching the given platform.
                              Repeatable.
  -V, --version             Print version information and exit.
  -w, --warn                Set log level to warn.

If --config-file is undefined then the command assumes the file is named jreleaser.[yml|toml|json] and it’s found at the current directory.

If --basedir is undefined then the command assumes it’s the same directory that contains the resolved config file.

template

$ jreleaser template -h
Usage: jreleaser template [-dhioqsVw] [-b=<basedir>] [-od=<outputdir>]
                          ([-an=<announcerName>] | [-dn=<distributionName>
                          -tn=<toolName> [-dt=<distributionType>]])
Generate a tool/announcer template.
  -b, --basedir=<basedir>   Base directory.
  -d, --debug               Set log level to debug.
  -h, --help                Show this help message and exit.
  -i, --info                Set log level to info.
  -o, --overwrite           Overwrite existing files.
      -od, --output-directory=<outputdir>
                            Output directory.
  -q, --quiet               Log errors only.
  -s, --snapshot            Use snapshot templates.
  -V, --version             Print version information and exit.
  -w, --warn                Set log level to warn.
Announcer templates
      -an, --announcer-name=<announcerName>
                            The name of the announcer.
Tool templates
      -dn, --distribution-name=<distributionName>
                            The name of the distribution.
      -dt, --distribution-type=<distributionType>
                            The type of the distribution.
                            Defaults to JAVA_BINARY.
      -tn, --tool-name=<toolName>
                            The name of the tool.

If --basedir is undefined then the command assumes it’s the current directory.

Announcer and tool settings are mutually exclusive.

The value of --announcer-name must match any of the available announcers.

The value of --distribution-name must match the name of a configured distribution.

The value of --distribution-type must match any of the available distribution types.

The value of --tool-name must match any of the available Packagers.

assemble

$ jreleaser assemble -h
Usage: jreleaser assemble [-dhiqVw] [-grs] [-an=<assemblerName>] [-b=<basedir>]
                          [-c=<configFile>] [-dn=<distributionName>]
                          [-od=<outputdir>] [-p=<key=value>]...
Assemble distributions.
      -an, --assembler-name=<assemblerName>
                            The name of the assembler.
  -b, --basedir=<basedir>   Base directory.
  -c, --config-file=<configFile>
                            The config file
  -d, --debug               Set log level to debug.
      -dn, --distribution-name=<distributionName>
                            The name of the distribution.
      -grs, --git-root-search
                            Searches for the Git root.
  -h, --help                Show this help message and exit.
  -i, --info                Set log level to info.
      -od, --output-directory=<outputdir>
                            Output directory.
  -p, --set-property=<key=value>
                            Sets the value of a property. Repeatable.
  -q, --quiet               Log errors only.
  -V, --version             Print version information and exit.
  -w, --warn                Set log level to warn.

If --config-file is undefined then the command assumes the file is named jreleaser.[yml|toml|json] and it’s found at the current directory.

If --basedir is undefined then the command assumes it’s the same directory that contains the resolved config file.

The value of --assembler-name must match any of the available assemblers.

The value of --distribution-name must match the name of a configured found in the assemblers section.

This command must be invoked separatedly from the others as some of the assmeblers are platform specific.

changelog

$ jreleaser changelog -h
Usage: jreleaser changelog [-dhiqVw] [-grs] [-b=<basedir>] [-c=<configFile>]
                           [-od=<outputdir>] [-p=<key=value>]...
Calculate the changelog.
  -b, --basedir=<basedir>   Base directory.
  -c, --config-file=<configFile>
                            The config file
  -d, --debug               Set log level to debug.
      -grs, --git-root-search
                            Searches for the Git root.
  -h, --help                Show this help message and exit.
  -i, --info                Set log level to info.
      -od, --output-directory=<outputdir>
                            Output directory.
  -p, --set-property=<key=value>
                            Sets the value of a property. Repeatable.
  -q, --quiet               Log errors only.
  -V, --version             Print version information and exit.
  -w, --warn                Set log level to warn.

If --config-file is undefined then the command assumes the file is named jreleaser.[yml|toml|json] and it’s found at the current directory.

If --basedir is undefined then the command assumes it’s the same directory that contains the resolved config file.

checksum

$ jreleaser checksum -h
Usage: jreleaser checksum [-dhiqVw] [-grs] [-scp] [-b=<basedir>]
                          [-c=<configFile>] [-od=<outputdir>]
                          [-p=<key=value>]... [-sp=<platform>]...
Calculate checksums.
  -b, --basedir=<basedir>   Base directory.
  -c, --config-file=<configFile>
                            The config file
  -d, --debug               Set log level to debug.
      -grs, --git-root-search
                            Searches for the Git root.
  -h, --help                Show this help message and exit.
  -i, --info                Set log level to info.
      -od, --output-directory=<outputdir>
                            Output directory.
  -p, --set-property=<key=value>
                            Sets the value of a property. Repeatable.
  -q, --quiet               Log errors only.
      -scp, --select-current-platform
                            Activates paths matching the current platform.
      -sp, --select-platform=<platform>
                            Activates paths matching the given platform.
                              Repeatable.
  -V, --version             Print version information and exit.
  -w, --warn                Set log level to warn.

If --config-file is undefined then the command assumes the file is named jreleaser.[yml|toml|json] and it’s found at the current directory.

If --basedir is undefined then the command assumes it’s the same directory that contains the resolved config file.

sign

$ jreleaser sign -h
Usage: jreleaser sign [-dhiqVw] [-grs] [-scp] [-b=<basedir>] [-c=<configFile>]
                      [-od=<outputdir>] [-p=<key=value>]... [-sp=<platform>]...
Sign release artifacts.
  -b, --basedir=<basedir>   Base directory.
  -c, --config-file=<configFile>
                            The config file
  -d, --debug               Set log level to debug.
      -grs, --git-root-search
                            Searches for the Git root.
  -h, --help                Show this help message and exit.
  -i, --info                Set log level to info.
      -od, --output-directory=<outputdir>
                            Output directory.
  -p, --set-property=<key=value>
                            Sets the value of a property. Repeatable.
  -q, --quiet               Log errors only.
      -scp, --select-current-platform
                            Activates paths matching the current platform.
      -sp, --select-platform=<platform>
                            Activates paths matching the given platform.
                              Repeatable.
  -V, --version             Print version information and exit.
  -w, --warn                Set log level to warn.

If --config-file is undefined then the command assumes the file is named jreleaser.[yml|toml|json] and it’s found at the current directory.

If --basedir is undefined then the command assumes it’s the same directory that contains the resolved config file.

upload

$ jreleaser upload -h
Usage: jreleaser upload [-dhiqVwy] [-grs] [-scp] [-b=<basedir>]
                        [-c=<configFile>] [-od=<outputdir>]
                        [-un=<uploaderName>] [-ut=<uploaderType>]
                        [-p=<key=value>]... [-sp=<platform>]...
Upload all artifacts.
  -b, --basedir=<basedir>   Base directory.
  -c, --config-file=<configFile>
                            The config file
  -d, --debug               Set log level to debug.
      -grs, --git-root-search
                            Searches for the Git root.
  -h, --help                Show this help message and exit.
  -i, --info                Set log level to info.
      -od, --output-directory=<outputdir>
                            Output directory.
  -p, --set-property=<key=value>
                            Sets the value of a property. Repeatable.
  -q, --quiet               Log errors only.
      -scp, --select-current-platform
                            Activates paths matching the current platform.
      -sp, --select-platform=<platform>
                            Activates paths matching the given platform.
                              Repeatable.
      -un, --uploader-name=<uploaderName>
                            The name of the uploader.
      -ut, --uploader-type=<uploaderType>
                            The type of the uploader.
  -V, --version             Print version information and exit.
  -w, --warn                Set log level to warn.
  -y, --dryrun              Skip remote operations.

If --config-file is undefined then the command assumes the file is named jreleaser.[yml|toml|json] and it’s found at the current directory.

If --basedir is undefined then the command assumes it’s the same directory that contains the resolved config file.

The value of --uploader-type must match the type of a configured uploader.

The value of --uploader-name must match any of the available uploaders.

Use -y or --dryrun during development to verify your configuration settings. No network uploads nor repository mutations should occur when this mode is activated.

You may invoke this command in the following ways:

Upload all artifacts:

$ jreleaser upload

Upload all artifacts to all configured Artifactory uploaders:

$ jreleaser upload --uploader-type artifactory

Upload all artifacts with all uploaders with matching name:

$ jreleaser upload --uploader-name mine

Upload all artifacts to a matching Artifactory uploader:

$ jreleaser upload --uploader-type artifactory --uploader-name mine

release

$ jreleaser release -h
Usage: jreleaser release [-dhiqVwy] [--auto-config] [--changelog-formatted]
                         [--draft] [-grs] [--overwrite] [--prerelease]
                         [--project-snapshot-full-changelog] [-scp]
                         [--signing-armored] [--signing-enabled]
                         [--skip-release] [--skip-tag] [--update]
                         [-b=<basedir>] [--branch=<branch>] [-c=<configFile>]
                         [--changelog=<changelog>]
                         [--commit-author-email=<commitAuthorEmail>]
                         [--commit-author-name=<commitAuthorName>]
                         [--milestone-name=<milestoneName>] [-od=<outputdir>]
                         [--prerelease-pattern=<prereleasePattern>]
                         [--project-name=<projectName>]
                         [--project-snapshot-label=<projectSnapshotLabel>]
                         [--project-snapshot-pattern=<projectSnapshotPattern>]
                         [--project-version=<projectVersion>]
                         [--project-version-pattern=<projectVersionPattern>]
                         [--release-name=<releaseName>] [--tag-name=<tagName>]
                         [--username=<username>] [--file=<file>]...
                         [--glob=<file>]... [-p=<key=value>]...
                         [-sp=<platform>]... [--update-section=<section>]...
Create or update a release.
      --auto-config          Model auto configuration.
  -b, --basedir=<basedir>    Base directory.
      --branch=<branch>      The release branch.
  -c, --config-file=<configFile>
                             The config file
      --changelog=<changelog>
                             Path to changelog file.
      --changelog-formatted  Format generated changelog.
      --commit-author-email=<commitAuthorEmail>
                             Commit author e-mail.
      --commit-author-name=<commitAuthorName>
                             Commit author name.
  -d, --debug                Set log level to debug.
      --draft                If the release is a draft.
      --file=<file>          Input file to be uploaded. Repeatable.
      --glob=<file>          Input file to be uploaded (as glob). Repeatable.
      -grs, --git-root-search
                             Searches for the Git root.
  -h, --help                 Show this help message and exit.
  -i, --info                 Set log level to info.
      --milestone-name=<milestoneName>
                             The milestone name.
      -od, --output-directory=<outputdir>
                             Output directory.
      --overwrite            Overwrite an existing release.
  -p, --set-property=<key=value>
                             Sets the value of a property. Repeatable.
      --prerelease           If the release is a prerelease.
      --prerelease-pattern=<prereleasePattern>
                             The prerelease pattern.
      --project-name=<projectName>
                             The project name.
      --project-snapshot-full-changelog
                             Calculate full changelog since last non-snapshot
                               release.
      --project-snapshot-label=<projectSnapshotLabel>
                             The project snapshot label.
      --project-snapshot-pattern=<projectSnapshotPattern>
                             The project snapshot pattern.
      --project-version=<projectVersion>
                             The project version.
      --project-version-pattern=<projectVersionPattern>
                             The project version pattern.
  -q, --quiet                Log errors only.
      --release-name=<releaseName>
                             The release name.
      -scp, --select-current-platform
                             Activates paths matching the current platform.
      --signing-armored      Generate ascii armored signatures.
      --signing-enabled      Sign files.
      --skip-release         Skip creating a release.
      --skip-tag             Skip tagging the release.
      -sp, --select-platform=<platform>
                             Activates paths matching the given platform.
                               Repeatable.
      --tag-name=<tagName>   The release tag.
      --update               Update an existing release.
      --update-section=<section>
                             Release section to be updated. Repeatable.
      --username=<username>  Git username.
  -V, --version              Print version information and exit.
  -w, --warn                 Set log level to warn.
  -y, --dryrun               Skip remote operations.

There are two usage modes:

  • auto config

  • with explicit configuration file

AutoConfig

If --basedir is undefined then the command assumes it’s the same directory where the command is run.

The --file parameter is repeatable.

The --glob parameter must be quote, for example --glob "target/*.jar".

Explicit Configuration file

If --config-file is undefined then the command assumes the file is named jreleaser.[yml|toml|json] and it’s found at the current directory.

If --basedir is undefined then the command assumes it’s the same directory that contains the resolved config file.

None of the command flags that override model properties can be used in this mode.
Use -y or --dryrun during development to verify your configuration settings. No network uploads nor repository mutations should occur when this mode is activated.

prepare

$ jreleaser prepare -h
Usage: jreleaser prepare [-dhiqVw] [-grs] [-scp] [-b=<basedir>]
                         [-c=<configFile>] [-dn=<distributionName>]
                         [-od=<outputdir>] [-tn=<toolName>] [-p=<key=value>]...
                         [-sp=<platform>]...
Prepare all distributions.
  -b, --basedir=<basedir>   Base directory.
  -c, --config-file=<configFile>
                            The config file
  -d, --debug               Set log level to debug.
      -dn, --distribution-name=<distributionName>
                            The name of the distribution.
      -grs, --git-root-search
                            Searches for the Git root.
  -h, --help                Show this help message and exit.
  -i, --info                Set log level to info.
      -od, --output-directory=<outputdir>
                            Output directory.
  -p, --set-property=<key=value>
                            Sets the value of a property. Repeatable.
  -q, --quiet               Log errors only.
      -scp, --select-current-platform
                            Activates paths matching the current platform.
      -sp, --select-platform=<platform>
                            Activates paths matching the given platform.
                              Repeatable.
      -tn, --tool-name=<toolName>
                            The name of the tool.
  -V, --version             Print version information and exit.
  -w, --warn                Set log level to warn.

If --config-file is undefined then the command assumes the file is named jreleaser.[yml|toml|json] and it’s found at the current directory.

If --basedir is undefined then the command assumes it’s the same directory that contains the resolved config file.

The value of --distribution-name must match the name of a configured distribution.

The value of --tool-name must match any of the available Packagers.

You may invoke this command in the following ways:

Prepare all distributions:

$ jreleaser prepare

Prepare a single distribution with all configured tools:

$ jreleaser prepare --distribution-name app

Prepare all distributions with a single tool:

$ jreleaser prepare --tool-name brew

Prepare a single distribution with a single tool:

$ jreleaser prepare --distribution-name app --tool-name brew

package

$ jreleaser package -h
Usage: jreleaser package [-dhiqVwy] [-grs] [-scp] [-b=<basedir>]
                         [-c=<configFile>] [-dn=<distributionName>]
                         [-od=<outputdir>] [-tn=<toolName>] [-p=<key=value>]...
                         [-sp=<platform>]...
Package all distributions.
  -b, --basedir=<basedir>   Base directory.
  -c, --config-file=<configFile>
                            The config file
  -d, --debug               Set log level to debug.
      -dn, --distribution-name=<distributionName>
                            The name of the distribution.
      -grs, --git-root-search
                            Searches for the Git root.
  -h, --help                Show this help message and exit.
  -i, --info                Set log level to info.
      -od, --output-directory=<outputdir>
                            Output directory.
  -p, --set-property=<key=value>
                            Sets the value of a property. Repeatable.
  -q, --quiet               Log errors only.
      -scp, --select-current-platform
                            Activates paths matching the current platform.
      -sp, --select-platform=<platform>
                            Activates paths matching the given platform.
                              Repeatable.
      -tn, --tool-name=<toolName>
                            The name of the tool.
  -V, --version             Print version information and exit.
  -w, --warn                Set log level to warn.
  -y, --dryrun              Skip remote operations.

If --config-file is undefined then the command assumes the file is named jreleaser.[yml|toml|json] and it’s found at the current directory.

If --basedir is undefined then the command assumes it’s the same directory that contains the resolved config file.

The value of --distribution-name must match the name of a configured distribution.

The value of --tool-name must match any of the available Packagers.

You may invoke this command in the following ways:

Package all distributions:

$ jreleaser package

Package a single distribution with all configured tools:

$ jreleaser package --distribution-name app

Package all distributions with a single tool:

$ jreleaser package --tool-name brew

Package a single distribution with a single tool:

$ jreleaser package --distribution-name app --tool-name brew
Use -y or --dryrun during development to verify your configuration settings. No network uploads nor repository mutations should occur when this mode is activated.

publish

$ jreleaser publish -h
Usage: jreleaser publish [-dhiqVwy] [-grs] [-scp] [-b=<basedir>]
                         [-c=<configFile>] [-dn=<distributionName>]
                         [-od=<outputdir>] [-tn=<toolName>] [-p=<key=value>]...
                         [-sp=<platform>]...
Publish all distributions.
  -b, --basedir=<basedir>   Base directory.
  -c, --config-file=<configFile>
                            The config file
  -d, --debug               Set log level to debug.
      -dn, --distribution-name=<distributionName>
                            The name of the distribution.
      -grs, --git-root-search
                            Searches for the Git root.
  -h, --help                Show this help message and exit.
  -i, --info                Set log level to info.
      -od, --output-directory=<outputdir>
                            Output directory.
  -p, --set-property=<key=value>
                            Sets the value of a property. Repeatable.
  -q, --quiet               Log errors only.
      -scp, --select-current-platform
                            Activates paths matching the current platform.
      -sp, --select-platform=<platform>
                            Activates paths matching the given platform.
                              Repeatable.
      -tn, --tool-name=<toolName>
                            The name of the tool.
  -V, --version             Print version information and exit.
  -w, --warn                Set log level to warn.
  -y, --dryrun              Skip remote operations.

If --config-file is undefined then the command assumes the file is named jreleaser.[yml|toml|json] and it’s found at the current directory.

If --basedir is undefined then the command assumes it’s the same directory that contains the resolved config file.

The value of --distribution-name must match the name of a configured distribution.

The value of --tool-name must match any of the available Packagers.

You may invoke this command in the following ways:

Publish all distributions:

$ jreleaser publish

Publish a single distribution with all configured tools:

$ jreleaser publish --distribution-name app

Publish all distributions with a single tool:

$ jreleaser publish --tool-name brew

Publish a single distribution with a single tool:

$ jreleaser publish --distribution-name app --tool-name brew
Use -y or --dryrun during development to verify your configuration settings. No network uploads nor repository mutations should occur when this mode is activated.

announce

$ jreleaser announce -h
Usage: jreleaser announce [-dhiqVwy] [-grs] [-scp] [-an=<announcerName>]
                          [-b=<basedir>] [-c=<configFile>] [-od=<outputdir>]
                          [-p=<key=value>]... [-sp=<platform>]...
Announce a release.
      -an, --announcer-name=<announcerName>
                            The name of the announcer.
  -b, --basedir=<basedir>   Base directory.
  -c, --config-file=<configFile>
                            The config file
  -d, --debug               Set log level to debug.
      -grs, --git-root-search
                            Searches for the Git root.
  -h, --help                Show this help message and exit.
  -i, --info                Set log level to info.
      -od, --output-directory=<outputdir>
                            Output directory.
  -p, --set-property=<key=value>
                            Sets the value of a property. Repeatable.
  -q, --quiet               Log errors only.
      -scp, --select-current-platform
                            Activates paths matching the current platform.
      -sp, --select-platform=<platform>
                            Activates paths matching the given platform.
                              Repeatable.
  -V, --version             Print version information and exit.
  -w, --warn                Set log level to warn.
  -y, --dryrun              Skip remote operations.

If --config-file is undefined then the command assumes the file is named jreleaser.[yml|toml|json] and it’s found at the current directory.

If --basedir is undefined then the command assumes it’s the same directory that contains the resolved config file.

The value of --announcer-name must match any of the available announcers.

You may invoke this command in the following ways:

Announce with all configured announcers:

$ jreleaser announce

Announce with a single announcer:

$ jreleaser announce --announcer-name brew
Use -y or --dryrun during development to verify your configuration settings. No network uploads nor repository mutations should occur when this mode is activated.

full-release

$ jreleaser full-release -h
Usage: jreleaser full-release [-dhiqVwy] [-grs] [-scp] [-b=<basedir>]
                              [-c=<configFile>] [-od=<outputdir>]
                              [-p=<key=value>]... [-sp=<platform>]...
Perform a full release.
  -b, --basedir=<basedir>   Base directory.
  -c, --config-file=<configFile>
                            The config file
  -d, --debug               Set log level to debug.
      -grs, --git-root-search
                            Searches for the Git root.
  -h, --help                Show this help message and exit.
  -i, --info                Set log level to info.
      -od, --output-directory=<outputdir>
                            Output directory.
  -p, --set-property=<key=value>
                            Sets the value of a property. Repeatable.
  -q, --quiet               Log errors only.
      -scp, --select-current-platform
                            Activates paths matching the current platform.
      -sp, --select-platform=<platform>
                            Activates paths matching the given platform.
                              Repeatable.
  -V, --version             Print version information and exit.
  -w, --warn                Set log level to warn.
  -y, --dryrun              Skip remote operations.

If --config-file is undefined then the command assumes the file is named jreleaser.[yml|toml|json] and it’s found at the current directory.

If --basedir is undefined then the command assumes it’s the same directory that contains the resolved config file.

Use -y or --dryrun during development to verify your configuration settings. No network uploads nor repository mutations should occur when this mode is activated.