JReleaser Gradle Plugin

Executes a JReleaser workflow as a Gradle plugin.

Requires Gradle 6.x.

Install

build.gradle
plugins {
    id 'org.jreleaser' version '1.11.0'
}

Configuration

JReleaser may be configured using the Gradle DSL shown at Reference. Alternatively, an external configuration file may be used if the configFile field property is set in the jreleaser extension.

The following properties may also be set on the jreleaser configuration instance:

Setting Type Environment Variable Default

basedir

boolean

JRELEASER_BASEDIR

<current-execution-directory>

dryrun

boolean

JRELEASER_DRY_RUN

false

strict

boolean

JRELEASER_STRICT

false

gitRootSearch

boolean

JRELEASER_GIT_ROOT_SEARCH

false

dependsOnAssemble

boolean

true

selectCurrentPlatform

boolean

JRELEASER_SELECT_CURRENT_PLATFORM

false

selectPlatform

String

JRELEASER_SELECT_PLATFORMS

<empty-string>

rejectPlatform

String

JRELEASER_REJECT_PLATFORMS

<empty-string>

configFile

RegularFile

String

JRELEASER_DEFAULT_GIT_REMOTE

origin

if dependsOnAssemble is set to true (default) then many JReleaser tasks will depend on the execution of the assembleDist task. Set this property to false to skip this dependency.

JRELEASER_SELECT_PLATFORMs and JRELEASER_REJECT_PLATFORMs may define a command separated list of values such as osx-x86_64,linux-x86_64.

These additional environment variables are supported as well:

Environment Variable Description

NO_COLOR

disable colors in output

JRELEASER_NO_COLOR

disable colors in output

Filtering Artifacts

Many commands let you filter (include or exclude) artifacts using a combination of task flags or environment variables. This filter capability allows you to test out a release configuration on a node where not all artifacts may be available. For example, when building on linux-x86_64 while also having osx-x86_64 and windows-x86_64.

Include only for the current platform

Use the JRELEASER_SELECT_CURRENT_PLATFORM environment variable or the --select-current-platform task flag.

$ JRELEASER_SELECT_CURRENT_PLATFORM gradle jreleaserChecksum
$ gradle jreleaserChecksum --select-current-platform
Include a specific platform

Use the JRELEASER_SELECT_PLATFORMS environment variable or the --select-platform task flag, i.e,

$ JRELEASER_SELECT_PLATFORMS=osx-x86_64 gradle jreleaserChecksum
$ gradle jreleaserChecksum --select-platform=osx-x86_64

Every artifact whose platform property does not match the given platform will end up filtered out.

Exclude a specific platform

Use the JRELEASER_REJECT_PLATFORMS environment variable or the --reject-platform task flag, i.e,

$ JRELEASER_REJECT_PLATFORMS=windows-x86_64 gradle jreleaserChecksum
$ gradle jreleaserChecksumm --reject-platform=windows-x86_64

Every artifact whose platform property matches the given platform will end up filtered out.

Defaults

The following values will be taken directly from the Gradle project and added to JReleaser’s configuration when the matching JReleaser element has not been explicitly configured:

Build file JReleaser

project.name

project.name

project.version

project.version

project.description

project.description

project.group

project.java.groupId

project.name

project.java.artifactId

The value of project.java.multiProject will be set to true if the root project has children.

The value of project.java.version will be determined following these expressions in order:

  • ${project.targetCompatibility}

  • ${project.compilerRelease}

  • org.gradle.api.JavaVersion.current()

The following properties will be automatically mapped when the org.kordamp.gradle.project plugin is applied:

Kordamp JReleaser

config.info.description

project.description

config.info.links.website

project.links.homepage

config.info.authors

project.authors

config.info.tags

project.tags

config.info.licenses

project.license

config.info.inceptionYear

project.inceptionYear

Environment Variables

The following settings may also be specified via environment variables

Setting

Environment Variable

Default

JRELEASER_DEFAULT_GIT_REMOTE

origin

DSL Descriptors

The plugin ships with GDSL (IntelliJ) and DSLD (Eclipse) DSL descriptors that should provide code completion support for the jreleaser extension when using the Groovy DSL in Gradle scripts. These files should be picked up automatically but if that were not to be the case then you may download the files and register them with your IDE:

Tasks

The following tasks are provided:

jreleaserEnv

Path
     :jreleaserEnv

Type
     JReleaserEnvTask (org.jreleaser.gradle.plugin.tasks.JReleaserEnvTask)

Description
     Display environment variable names

Group
     JReleaser

jreleaserInit

Path
     :jreleaserInit

Type
     JReleaserInitTask (org.jreleaser.gradle.plugin.tasks.JReleaserInitTask)

Options
     --format                Configuration file format (REQUIRED).

     --overwrite             Overwrite existing files (OPTIONAL).

Description
     Create a jreleaser config file

Group
     JReleaser

Currently supported formats are: yml, json, and toml.

The file will be generated at the current directory.

jreleaserConfig

Path
     :jreleaserConfig

Type
     JReleaserConfigTask (org.jreleaser.gradle.plugin.tasks.JReleaserConfigTask)

Options
     --announce                 Display announce configuration (OPTIONAL).

     --assembly                 Display assembly configuration (OPTIONAL).

     --changelog                Display changelog configuration (OPTIONAL).

     --download                 Display download configuration (OPTIONAL).

     --dryrun                   Skip remote operations (OPTIONAL).

     --full                     Display full configuration (OPTIONAL).

     --git-root-search          Searches for the Git root (OPTIONAL).

     --reject-platform          Activates paths not matching the given platform (OPTIONAL).

     --select-current-platform  Activates paths matching the current platform (OPTIONAL).

     --select-platform          Activates paths matching the given platform (OPTIONAL).

     --strict                   Enable strict mode (OPTIONAL).

Description
     Outputs current JReleaser configuration

Group
     JReleaser

jreleaserTemplateGenerate

Path
     :jreleaserTemplateGenerate

Type
     JReleaserTemplateGenerateTask (org.jreleaser.gradle.plugin.tasks.JReleaserTemplateGenerateTask)

Options
     --announcer-name        The name of the announcer (OPTIONAL).

     --assembler-name        The name of the assembler (OPTIONAL).

     --assembler-type        The type of the assembler (OPTIONAL).

     --distribution-name     The name of the distribution (OPTIONAL).

     --distribution-type     The type of the distribution (OPTIONAL).
                             Available values are:
                                  JAVA_BINARY
                                  JLINK
                                  NATIVE_IMAGE
                                  NATIVE_PACKAGE
                                  SINGLE_JAR

     --overwrite             Overwrite existing files (OPTIONAL).

     --packager-name         The name of the packager (OPTIONAL).

     --snapshot              Use snapshot template (OPTIONAL).

Description
     Generates templates for a specific packager/announcer

Group
     JReleaser

jreleaserTemplateEval

Path
     :jreleaserTemplateEval

Type
     JReleaserTemplateEvalTask (org.jreleaser.gradle.plugin.tasks.JReleaserTemplateEvalTask)

Options
     --announce                 Eval model in announce configuration (OPTIONAL).

     --assembly                 Eval model in assembly configuration (OPTIONAL).

     --changelog                Eval model in changelog configuration (OPTIONAL).

     --download                 Eval model in download configuration (OPTIONAL).

     --dryrun                   Skip remote operations (OPTIONAL).

     --git-root-search          Searches for the Git root (OPTIONAL).

     --input-directory          A directory with input templates.

     --input-file               An input template file.

     --reject-platform          Activates paths not matching the given platform (OPTIONAL).

     --select-current-platform  Activates paths matching the current platform (OPTIONAL).

     --select-platform          Activates paths matching the given platform (OPTIONAL).

     --strict                   Enable strict mode (OPTIONAL).

     --target-directory         Directory where evaluated template(s) will be placed.

Description
     Evaluate a template or templates

Group
     JReleaser

jreleaserDownload

Executes the Download workflow step.

Path
     :jreleaserDownload

Type
     JReleaserDownloadTask (org.jreleaser.gradle.plugin.tasks.JReleaserDownloadTask)

Options
     --downloader-name           Include an downloader by name (OPTIONAL).

     --downloader                Include an downloader by type (OPTIONAL).

     --dryrun                    Skip remote operations (OPTIONAL).

     --exclude-downloader-name   Exclude an downloader by name (OPTIONAL).

     --exclude-downloader        Exclude an downloader by type (OPTIONAL).

     --git-root-search           Searches for the Git root (OPTIONAL).

     --strict                    Enable strict mode (OPTIONAL).

Description
     Downloads assets

Group
     JReleaser

jreleaserAssemble

Executes the Assemble workflow step.

Path
     :jreleaserAssemble

Type
     JReleaserAssembleTask (org.jreleaser.gradle.plugin.tasks.JReleaserAssembleTask)

Options
     --assembler                The name of the assembler (OPTIONAL).

     --distribution             The name of the distribution (OPTIONAL).

     --dryrun                   Skip remote operations (OPTIONAL).

     --exclude-assembler        Exclude an assembler (OPTIONAL).

     --exclude-distribution     Exclude a distribution (OPTIONAL).

     --git-root-search          Searches for the Git root (OPTIONAL).

     --reject-platform          Activates paths not matching the given platform (OPTIONAL).

     --select-current-platform  Activates paths matching the current platform (OPTIONAL).

     --select-platform          Activates paths matching the given platform (OPTIONAL).

     --strict                   Enable strict mode (OPTIONAL).

Description
     Assemble all distributions

Group
     JReleaser

jreleaserChangelog

Executes the Changelog workflow step.

Path
     :jreleaserChangelog

Type
     JReleaserChangelogTask (org.jreleaser.gradle.plugin.tasks.JReleaserChangelogTask)

Options:
     --strict                   Enable strict mode (OPTIONAL).

Description
     Calculate changelogs

Group
     JReleaser

jreleaserCatalog

Executes the Catalog workflow step.

Path
     :jreleaserCatalog

Type
     JReleaserCatalogTask (org.jreleaser.gradle.plugin.tasks.JReleaserCatalogTask)

Options
     --cataloger                Include a cataloger (OPTIONAL).

     --distribution             Include a distribution (OPTIONAL).

     --dryrun                   Skip remote operations (OPTIONAL).

     --exclude-cataloger        Exclude a cataloger (OPTIONAL).

     --exclude-distribution     Exclude a distribution (OPTIONAL).

     --git-root-search          Searches for the Git root (OPTIONAL).

     --reject-platform          Activates paths not matching the given platform (OPTIONAL).

     --select-current-platform  Activates paths matching the current platform (OPTIONAL).

     --select-platform          Activates paths matching the given platform (OPTIONAL).

     --strict                   Enable strict mode (OPTIONAL).

Description
     Catalogs all distributions and files

Group
     JReleaser

jreleaserChecksum

Executes the Checksum workflow step.

Path
     :jreleaserChecksum

Type
     JReleaserChecksumTask (org.jreleaser.gradle.plugin.tasks.JReleaserChecksumTask)

Options
     --distribution             The name of the distribution (OPTIONAL).

     --dryrun                   Skip remote operations (OPTIONAL).

     --exclude-distribution     Exclude a distribution (OPTIONAL).

     --git-root-search          Searches for the Git root (OPTIONAL).

     --reject-platform          Activates paths not matching the given platform (OPTIONAL).

     --select-current-platform  Activates paths matching the current platform (OPTIONAL).

     --select-platform          Activates paths matching the given platform (OPTIONAL).

     --strict                   Enable strict mode (OPTIONAL).

Description
     Calculate checksums

Group
     JReleaser

jreleaserSign

Executes the Sign workflow step.

Path
     :jreleaserSign

Type
     JReleaserSignTask (org.jreleaser.gradle.plugin.tasks.JReleaserSignTask)

Options
     --distribution             The name of the distribution (OPTIONAL).

     --dryrun                   Skip remote operations (OPTIONAL).

     --exclude-distribution     Exclude a distribution (OPTIONAL).

     --git-root-search          Searches for the Git root (OPTIONAL).

     --reject-platform          Activates paths not matching the given platform (OPTIONAL).

     --select-current-platform  Activates paths matching the current platform (OPTIONAL).

     --select-platform          Activates paths matching the given platform (OPTIONAL).

     --strict                   Enable strict mode (OPTIONAL).

Description
     Signs a release

Group
     JReleaser

jreleaserDeploy

Executes the Deploy workflow step.

Path
     :jreleaserDeploy

Type
     JReleaserDeployTask (org.jreleaser.gradle.plugin.tasks.JReleaserDeployTask)

Options
     --deployer                  Include a deployer by type (OPTIONAL).

     --deployer-name             Include a deployer by name (OPTIONAL).

     --dryrun                    Skip remote operations (OPTIONAL).

     --exclude-deployer          Exclude a deployer by type (OPTIONAL).

     --exclude-deployer-name     Exclude a deployer by name (OPTIONAL).

     --git-root-search           Searches for the Git root (OPTIONAL).

     --strict                    Enable strict mode (OPTIONAL).

Description
     Deploys all staged artifacts

Group
     JReleaser

jreleaserUpload

Executes the Upload workflow step.

Path
     :jreleaserUpload

Type
     JReleaserUploadTask (org.jreleaser.gradle.plugin.tasks.JReleaserUploadTask)

Options
     --cataloger                 Include a cataloger (OPTIONAL).

     --distribution              The name of the distribution (OPTIONAL).

     --dryrun                    Skip remote operations (OPTIONAL).

     --exclude-cataloger         Exclude a cataloger (OPTIONAL).

     --exclude-distribution      Exclude a distribution (OPTIONAL).

     --exclude-uploader-name     Exclude an uploader by name (OPTIONAL).

     --exclude-uploader          Exclude an uploader by type (OPTIONAL).

     --git-root-search           Searches for the Git root (OPTIONAL).

     --reject-platform           Activates paths not matching the given platform (OPTIONAL).

     --select-current-platform   Activates paths matching the current platform (OPTIONAL).

     --select-platform           Activates paths matching the given platform (OPTIONAL).

     --strict                    Enable strict mode (OPTIONAL).

     --uploader-name             Include an uploader by name (OPTIONAL).

     --uploader                  Include an uploader by type (OPTIONAL).

Description
     Uploads all artifacts

Group
     JReleaser

jreleaserRelease

Executes the Release workflow step.

Path
     :jreleaserRelease

Type
     JReleaserReleaseTask (org.jreleaser.gradle.plugin.tasks.JReleaserReleaserTask)

Options
     --cataloger                Include a cataloger (OPTIONAL).

     --deployer                 Include a deployer by type (OPTIONAL).

     --deployer-name            Include a deployer by name (OPTIONAL).

     --distribution             The name of the distribution (OPTIONAL).

     --dryrun                   Skip remote operations (OPTIONAL).

     --exclude-cataloger        Exclude a cataloger (OPTIONAL).

     --exclude-deployer         Exclude a deployer by type (OPTIONAL).

     --exclude-deployer-name    Exclude a deployer by name (OPTIONAL).

     --exclude-distribution     Exclude a distribution (OPTIONAL).

     --exclude-uploader         Exclude an uploader by type (OPTIONAL).

     --exclude-uploader-name    Exclude an uploader by name (OPTIONAL).

     --git-root-search          Searches for the Git root (OPTIONAL).

     --reject-platform          Activates paths not matching the given platform (OPTIONAL).

     --select-current-platform  Activates paths matching the current platform (OPTIONAL).

     --select-platform          Activates paths matching the given platform (OPTIONAL).

     --strict                   Enable strict mode (OPTIONAL).

     --uploader                 Include an uploader by type (OPTIONAL).

     --uploader-name            Include an uploader by name (OPTIONAL).
Description
     Uploads all artifacts

Group
     JReleaser

jreleaserPrepare

Executes the Prepare workflow step.

Path
     :jreleaserPrepare

Type
     JReleaserPrepareTask (org.jreleaser.gradle.plugin.tasks.JReleaserPrepareTask)

Options
     --distribution             Include a distribution (OPTIONAL).

     --dryrun                   Skip remote operations (OPTIONAL).

     --exclude-distribution     Exclude a distribution (OPTIONAL).

     --exclude-packager         Exclude a packager (OPTIONAL).

     --git-root-search          Searches for the Git root (OPTIONAL).

     --packager                 Include a packager (OPTIONAL).

     --reject-platform          Activates paths not matching the given platform (OPTIONAL).

     --select-current-platform  Activates paths matching the current platform (OPTIONAL).

     --select-platform          Activates paths matching the given platform (OPTIONAL).

     --strict                   Enable strict mode (OPTIONAL).

Description
     Prepares all distributions

Group
     JReleaser

jreleaserPackage

Executes the Package workflow step.

Path
     :jreleaserPackage

Type
     JReleaserPackageTask (org.jreleaser.gradle.plugin.tasks.JReleaserPackageTask)

Options
     --distribution             Include a distribution (OPTIONAL).

     --dryrun                   Skip remote operations (OPTIONAL).

     --exclude-distribution     Exclude a distribution (OPTIONAL).

     --exclude-packager         Exclude a packager (OPTIONAL).

     --git-root-search          Searches for the Git root (OPTIONAL).

     --packager                 Include a packager (OPTIONAL).

     --reject-platform          Activates paths not matching the given platform (OPTIONAL).

     --select-current-platform  Activates paths matching the current platform (OPTIONAL).

     --select-platform          Activates paths matching the given platform (OPTIONAL).

     --strict                   Enable strict mode (OPTIONAL).

Description
     Packages all distributions

Group
     JReleaser

jreleaserPublish

Executes the Publish workflow step.

Path
     :jreleaserPublish

Type
     JReleaserPublishTask (org.jreleaser.gradle.plugin.tasks.JReleaserPublishTask)

Options
     --distribution             Include a distribution (OPTIONAL).

     --dryrun                   Skip remote operations (OPTIONAL).

     --exclude-distribution     Exclude a distribution (OPTIONAL).

     --exclude-packager         Exclude a packager (OPTIONAL).

     --git-root-search          Searches for the Git root (OPTIONAL).

     --packager                 Include a packager (OPTIONAL).

     --reject-platform          Activates paths not matching the given platform (OPTIONAL).

     --select-current-platform  Activates paths matching the current platform (OPTIONAL).

     --select-platform          Activates paths matching the given platform (OPTIONAL).

     --strict                   Enable strict mode (OPTIONAL).

Description
     Publishes all distributions

Group
     JReleaser

jreleaserAnnounce

Executes the Announce workflow step.

Path
     :jreleaserAnnounce

Type
     JReleaserAnnounceTask (org.jreleaser.gradle.plugin.tasks.JReleaserAnnounceTask)

Options
     --announcer                Include an announcer (OPTIONAL).

     --dryrun                   Skip remote operations (OPTIONAL).

     --exclude-announcer        Exclude an announcer (OPTIONAL).

     --git-root-search          Searches for the Git root (OPTIONAL).

     --strict                   Enable strict mode (OPTIONAL).

Description
     Announces a release

Group
     JReleaser

jreleaserFullRelease

Executes the Full Release workflow step.

Path
     :jreleaserFullRelease

Type
     JReleaserFullReleaseTask (org.jreleaser.gradle.plugin.tasks.JReleaserFullReleaseTask)

Options
     --announcer                Include an announcer (OPTIONAL).

     --cataloger                Include a cataloger (OPTIONAL).

     --deployer                 Include a deployer by type (OPTIONAL).

     --deployer-name            Include a deployer by name (OPTIONAL).

     --distribution             Include a distribution (OPTIONAL).

     --dryrun                   Skip remote operations (OPTIONAL).

     --exclude-announcer        Exclude an announcer (OPTIONAL).

     --exclude-cataloger        Exclude a cataloger (OPTIONAL).

     --exclude-deployer         Exclude a deployer by type (OPTIONAL).

     --exclude-deployer-name    Exclude a deployer by name (OPTIONAL).

     --exclude-distribution     Exclude a distribution (OPTIONAL).

     --exclude-packager         Exclude a packager (OPTIONAL).

     --exclude-uploader         Exclude an uploader by type (OPTIONAL).

     --exclude-uploader-name    Exclude an uploader by name (OPTIONAL).

     --git-root-search          Searches for the Git root (OPTIONAL).

     --packager                 Include a packager (OPTIONAL).

     --reject-platform          Activates paths not matching the given platform (OPTIONAL).

     --select-current-platform  Activates paths matching the current platform (OPTIONAL).

     --select-platform          Activates paths matching the given platform (OPTIONAL).

     --strict                   Enable strict mode (OPTIONAL).

     --uploader                 Include an uploader by type (OPTIONAL).

     --uploader-name            Include an uploader by name (OPTIONAL).

Description
     Invokes release, publish, and announce

Group
     JReleaser

jreleaserAutoConfigRelease

Path
     :jreleaserAutoConfigRelease

Type
     JReleaseAutoConfigReleaseTask (org.jreleaser.gradle.plugin.tasks.JReleaseAutoConfigReleaseTask)

Options
     --armored                         Generate ascii armored signatures (OPTIONAL).

     --author                          The project authors (OPTIONAL).

     --branch                          The release branch (OPTIONAL).

     --changeLog                       Path to changelog file (OPTIONAL).

     --changelog-formatted             Format generated changelog (OPTIONAL).

     --commit-author-email             Commit author email (OPTIONAL).

     --commit-author-name              Commit author name (OPTIONAL).

     --draft                           If the release is a draft (OPTIONAL).

     --dryrun                          Skip remote operations (OPTIONAL).

     --file                            Input file(s) to be uploaded (OPTIONAL).

     --git-root-search                 Searches for the Git root (OPTIONAL).

     --glob                            Input file(s) to be uploaded (as globs) (OPTIONAL).

     --milestone-name                  The milestone name (OPTIONAL).

     --overwrite                       Overwrite an existing release (OPTIONAL).

     --prerelease                      If the release is a prerelease (OPTIONAL).

     --prerelease-pattern              The prerelease pattern (OPTIONAL).

     --project-copyright               The project copytight (OPTIONAL).

     --project-description             The project description (OPTIONAL).

     --project-inception-year          The project inception year (OPTIONAL).

     --project-name                    The project name (OPTIONAL).

     --project-snapshot-label          The project snapshot label (OPTIONAL).

     --project-snapshot-pattern        The project snapshot pattern (OPTIONAL).

     --project-snapshot-full-changelog Calculate full changelog since last non-snapshot release (OPTIONAL).

     --project-stereotype              The project stereotype (OPTIONAL).

     --project-version                 The project version (OPTIONAL).

     --project-version-pattern         The project version pattern (OPTIONAL).

     --release-name                    The release name (OPTIONAL).

     --signing                         Sign files (OPTIONAL).

     --reject-platform                 Activates paths not matching the given platform (OPTIONAL).

     --select-current-platform         Activates paths matching the current platform (OPTIONAL).

     --select-platform                 Activates paths matching the given platform (OPTIONAL).

     --skip-checksums                  Skip creating checksums (OPTIONAL).

     --skip-release                    Skip creating a release (OPTIONAL).

     --skip-tag                        Skip tagging the release (OPTIONAL).

     --strict                          Enable strict mode (OPTIONAL).

     --tag-name                        The release tga (OPTIONAL).

     --update                          Update an existing release (OPTIONAL).

     --update-section                  Release section to be updated (OPTIONAL).

     --username                        Git username (OPTIONAL).

Description
     Creates or updates a release with auto-config enabled

Group
     JReleaser

jreleaserJsonSchema

Path
     :jreleaserJsonSchema

Type
     JReleaserJsonSchemaTask (org.jreleaser.gradle.plugin.tasks.JReleaserJsonSchemaTask)

Description
    Generate JSON schema.

Group
     JReleaser