Sdkman

Publishes a distribution to Sdkman. Please follow the instructions at https://sdkman.io/vendors to register your project as a candidate and obtain publishing credentials.

The following artifact extensions are supported by this packager:

  • .zip

Distribution Support

Distribution Supported

Binary

Flat Binary

Java Binary

Jlink

Native Image

Native Package

Single JAR

Configuring this packager automatically enables the Sdkman announcer.
Publication of snapshots is not allowed.

Configuration

Legend:

  • required

  • optional

  • may use environment variable

  • accepts Name Templates

  • YAML

  • TOML

  • JSON

  • Maven

  • Gradle

# 
packagers:
  # 
  sdkman:
    # Enables or disables Sdkman.
    # Supported values are [`NEVER`, `ALWAYS`, `RELEASE`, `SNAPSHOT`].
    # Defaults to `NEVER`.
    #  
    active: ALWAYS

    # Let the release continue if the packager fails.
    # Defaults to `false`.
    # 
    continueOnError: true

    # Custom download URL.
    #  
    downloadUrl: https://my.server.com/{{projectName}}/{{tagName}}/{{artifactFile}}

    # Additional properties used when evaluating templates.
    #  
    extraProperties:
      # Key will be capitalized and prefixed with `sdkman`, i.e, `sdkmanFoo`.
      foo: bar

    # Defines the connection timeout in seconds.
    # Defaults to `20`.
    # 
    connectTimeout: 20

    # Defines the read timeout in seconds.
    # Defaults to `60`.
    # 
    readTimeout: 60

    # The name of the candidate registered in the Sdkman database.
    # If unspecified, will use `#{distribution.name}`.
    # 
    candidate: app

    # Sdkman command to use.
    # Supported values are [`MAJOR`, `MINOR`]
    # Defaults to `MAJOR`.
    # 
    command: MAJOR

    # The release notes URL to use.
    # Defaults to `#{release.${releaser}.releaseNotesUrl}`.
    #  
    releaseNotesUrl: https://host.com/{{projectName}}/{{tagName}}

    # The consumer key for publishing to Sdkman.
    #  
    consumerKey: __USE_ENVIRONMENT_VARIABLE__

    # The consumer token for publishing to Sdkman.
    #  
    consumerToken: __USE_ENVIRONMENT_VARIABLE__
# 
[packagers.sdkman]
  # Enables or disables Sdkman.
  # Supported values are [`NEVER`, `ALWAYS`, `RELEASE`, `SNAPSHOT`].
  # Defaults to `NEVER`.
  #  
  active = "ALWAYS"

  # Let the release continue if the packager fails.
  # Defaults to `false`.
  # 
  continueOnError = true

  # Custom download URL.
  #  
  downloadUrl = "https://my.server.com/{{projectName}}/{{tagName}}/{{artifactFile}}"

  # Additional properties used when evaluating templates.
  #  
  extraProperties.foo = "bar"
  # Key will be capitalized and prefixed with `sdkman`, i.e, `sdkmanFoo`.

  # Defines the connection timeout in seconds.
  # Defaults to `20`.
  # 
  connectTimeout = 20

  # Defines the read timeout in seconds.
  # Defaults to `60`.
  # 
  readTimeout = 60

  # The name of the candidate registered in thew Sdkman database.
  # If unspecified, will use #{distribution.name}.
  # 
  candidate = "app"

  # The release notes URL to use.
  # Defaults to `#{release.${releaser}.releaseNotesUrl}`.
  #  
  releaseNotesUrl = "https://host.com/{{projectName}}/{{tagName}}"

  # Sdkman command to use.
  # Supported values are [`MAJOR`, `MINOR`]
  # Defaults to `MAJOR`.
  # 
  command = "MAJOR"

  # The consumer key for publishing to Sdkman.
  #  
  consumerKey = "__USE_ENVIRONMENT_VARIABLE__"

  # The consumer token for publishing to Sdkman.
  #  
  consumerToken = "__USE_ENVIRONMENT_VARIABLE__"
{
  // 
  "packagers": {
    // 
    "sdkman": {
      // Enables or disables Sdkman.
      // Supported values are [`NEVER`, `ALWAYS`, `RELEASE`, `SNAPSHOT`].
      // Defaults to `NEVER`.
      //  
      "active": "ALWAYS",

      // Let the release continue if the packager fails.
      // Defaults to `false`.
      // 
      "continueOnError": true,

      // Custom download URL.
      //  
      "downloadUrl": "https://my.server.com/{{projectName}}/{{tagName}}/{{artifactFile}}",

      // Additional properties used when evaluating templates.
      //  
      "extraProperties": {
        // Key will be capitalized and prefixed with `sdkman`, i.e, `sdkmanFoo`.
        "foo": "bar"
      },

      // Defines the connection timeout in seconds.
      // Defaults to `20`.
      // 
      "connectTimeout": 20,

      // Defines the read timeout in seconds.
      // Defaults to `60`.
      // 
      "readTimeout": 60,

      // The name of the candidate registered in thew Sdkman database.
      // If unspecified, will use #{distribution.name}.
      // 
      "candidate": "app",

      // The release notes URL to use.
      // Defaults to `#{release.${releaser}.releaseNotesUrl}`.
      //  
      "releaseNotesUrl": "https://host.com/{{projectName}}/{{tagName}}",

      // Sdkman command to use.
      // Supported values are [`MAJOR`, `MINOR`]
      // Defaults to `MAJOR`.
      // 
      "command": "MAJOR",

      // The consumer key for publishing to Sdkman.
      //  
      "consumerKey": "__USE_ENVIRONMENT_VARIABLE__",

      // The consumer token for publishing to Sdkman.
      //  
      "consumerToken": "__USE_ENVIRONMENT_VARIABLE__"
    }
  }
}
<jreleaser>
  <!--
    
  -->
  <packagers>
    <!--
      
    -->
    <sdkman>
      <!--
        Enables or disables Sdkman.
        Supported values are [`NEVER`, `ALWAYS`, `RELEASE`, `SNAPSHOT`].
        Defaults to `NEVER`.
         
      -->
      <active>ALWAYS</active>

      <!--
        Let the release continue if the packager fails.
        Defaults to `false`.
        
      -->
      <continueOnError>true</continueOnError>

      <!--
        Custom download URL.
         
      -->
      <downloadUrl>https://my.server.com/{{projectName}}/{{tagName}}/{{artifactFile}}</downloadUrl>

      <!--
        Additional properties used when evaluating templates.
         
      -->
      <extraProperties>
        <!--
          Key will be capitalized and prefixed with `sdkman`, i.e, `sdkmanFoo`.
        -->
        <foo>bar</foo>
      </extraProperties>

      <!--
        Defines the connection timeout in seconds.
        Defaults to `20`.
        
      -->
      <connectTimeout>20</connectTimeout>

      <!--
        Defines the read timeout in seconds.
        Defaults to `60`.
        
      -->
      <readTimeout>60</readTimeout>

      <!--
        The name of the candidate registered in thew Sdkman database.
        If unspecified, will use #{distribution.name}.
        
      -->
      <candidate>app</candidate>

      <!--
        The release notes URL to use.
        Defaults to `#{release.${releaser}.releaseNotesUrl}`.
         
      -->
      <releaseNotesUrl>https://host.com/{{projectName}}/{{tagName}}</releaseNotesUrl>

      <!--
        Sdkman command to use.
        Supported values are [`MAJOR`, `MINOR`]
        Defaults to `MAJOR`.
        
      -->
      <command>MAJOR</command>

      <!--
        The consumer key for publishing to Sdkman.
         
      -->
      <consumerKey>__USE_ENVIRONMENT_VARIABLE__</consumerKey>

      <!--
        The consumer token for publishing to Sdkman.
         
      -->
      <consumerToken>__USE_ENVIRONMENT_VARIABLE__</consumerToken>
    </sdkman>
  </packagers>
</jreleaser>
jreleaser {
  // 
  packagers {
    // 
    sdkman {
      // Enables or disables Sdkman.
      // Supported values are [`NEVER`, `ALWAYS`, `RELEASE`, `SNAPSHOT`].
      // Defaults to `NEVER`.
      //  
      active = 'ALWAYS'

      // Let the release continue if the packager fails.
      // Defaults to `false`.
      // 
      continueOnError = true

      // Custom download URL.
      //  
      downloadUrl = 'https://my.server.com/{{projectName}}/{{tagName}}/{{artifactFile}}'

      // Additional properties used when evaluating templates.
      // Key will be capitalized and prefixed with `sdkman`, i.e, `sdkmanFoo`.
      //  
      extraProperties.put('foo', 'bar')

      // Defines the connection timeout in seconds.
      // Defaults to `20`.
      // 
      connectTimeout = 20

      // Defines the read timeout in seconds.
      // Defaults to `60`.
      // 
      readTimeout = 60

      // The name of the candidate registered in thew Sdkman database.
      // If unspecified, will use #{distribution.name}.
      // 
      candidate = 'app'

      // The release notes URL to use.
      // Defaults to `#{release.${releaser}.releaseNotesUrl}`.
      //  
      releaseNotesUrl = 'https://host.com/{{projectName}}/{{tagName}}'

      // Sdkman command to use.
      // Supported values are [`MAJOR`, `MINOR`]
      // Defaults to `MAJOR`.
      // 
      command = 'MAJOR'

      // The consumer key for publishing to Sdkman.
      //  
      consumerKey = '__USE_ENVIRONMENT_VARIABLE__'

      // The consumer token for publishing to Sdkman.
      //  
      consumerToken = '__USE_ENVIRONMENT_VARIABLE__'
    }
  }
}
Candidate names must be unique!

Environment

When not explicitly set, the value of the following properties may be resolved from an environment variable or a system property as shown in the table. The system property takes precedence over the environment variable.

Inside packagers section

System Property Environment Variable

active

jreleaser.packagers.sdkman.active

JRELEASER_PACKAGERS_SDKMAN_ACTIVE

Inside distributions section

System Property Environment Variable

active

jreleaser.distributions.${name}.sdkman.active

JRELEASER_DISTRIBUTIONS_${name}_SDKMAN_ACTIVE

consumerKey

jreleaser.distributions.${name}.sdkman.consumer.key
jreleaser.sdkman.consumer.key

JRELEASER_DISTRIBUTIONS_${name}_SDKMAN_CONSUMER_KEY
JRELEASER_SDKMAN_CONSUMER_KEY

consumerToken

jreleaser.distributions.${name}.sdkman.consumer.token
jreleaser.sdkman.consumer.token

JRELEASER_DISTRIBUTIONS_${name}_SDKMAN_CONSUMER_TOKEN
JRELEASER_SDKMAN_CONSUMER_TOKEN

Substitute ${name} for the value of the named instance.

Space (' '), underscore (_), and dash (-) will be replaced by dot (.) to separate tokens in the System property. Space (' '), dash (-), and dot (.) will be replaced by underscore (_) to separate tokens in the environment variable, such that:

${name} System Property Environment Variable

foobar

foobar

FOOBAR

fooBar

foobar

FOOBAR

foo bar

foo.bar

FOO_BAR

foo-bar

foo.bar

FOO_BAR

foo_bar

foo.bar

FOO_BAR

foo.bar

foo.bar

FOO_BAR

DownloadURL

JReleaser follows these rules to find the download URL to use for a given artifact:

  1. if artifact.extraProperties.sdkmanDownloadUrl exists, use it.

  2. if artifact.extraProperties.downloadUrl exists, use it.

  3. if explicit downloadUrl is set on sdkman, use it.

  4. if distribution.extraProperties.sdkmanDownloadUrl exists, use it.

  5. if distribution.extraProperties.downloadUrl exists, use it.

  6. if releaser.${release}.skipRelease is false then use the releaser’s downloadUrl.

  7. if releaser.${release}.skipRelease is true then look for a matching uploader given an extraProperty named downloadUrlFrom on artifact, distribution, `sdkman (in that order). The value must be <uploaderType>:<uploaderName> such as "artifactory:app" or "s3:uploads".

  8. fail if no suitable URL is found.

With no extra configuration from your side rule 6. will be chosen which is the suitable default that most projects need.

Skip Artifacts

You may mark artifacts to be skipped for this packager by adding an extra property name skipSdkman set to true.

Requirements

This packager has the following requirements:

  • Only zip artifacts are supported.

  • The default platform is set to UNIVERSAL if the artifact did not define a value for its platform field.

  • If there’s more than one artifact then each artifact requires distinct platform values, otherwise the latest artifact will override any previous matches by platform.

  • You may explicitly skip an artifact by defining an extra property named skipSdkman with a true value.

  • Publishing will be skipped if no suitable artifacts are found.

Supported platform values are:

  • mac, osx.

  • win, windows.

  • linux.

Command

You may set the command property to either MAJOR or MINOR. A MINOR release publishes a new version and posts an announcement. A MAJOR release performs the same actions as MINOR plus setting the recently published version as default. Thus, the only difference between MINOR and MAJOR is setting a given version as default.