Sdkman

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

If this announcer is enabled but no Sdkman packager is active in a distribution then the whole project will be released and announced.

Configuration

Legend:

  • required

  • optional

  • may use environment variable

  • accepts Name Templates

  • YAML

  • TOML

  • JSON

  • Maven

  • Gradle

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

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

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

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

    # The name of the candidate registered in thew Sdkman database.
    # If unspecified, will use `#{project.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}}

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

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

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

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

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

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

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

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

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

  # 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__"
{
  // 
  "announce": {
    // 
    "sdkman": {
      // Enables or disables Sdkman.
      // Supported values are [`NEVER`, `ALWAYS`, `RELEASE`, `SNAPSHOT`].
      // Defaults to `NEVER`.
      //  
      "active": "ALWAYS",

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

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

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

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

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

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

      // 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>
  <!--
    
  -->
  <announce>
    <!--
      
    -->
    <sdkman>
      <!--
        Enables or disables Sdkman.
        Supported values are [`NEVER`, `ALWAYS`, `RELEASE`, `SNAPSHOT`].
        Defaults to `NEVER`.
         
      -->
      <active>ALWAYS</active>

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

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

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

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

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

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

      <!--
        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>
  </announce>
</jreleaser>
jreleaser {
  // 
  announce {
    // 
    sdkman {
      // Enables or disables Sdkman.
      // Supported values are [`NEVER`, `ALWAYS`, `RELEASE`, `SNAPSHOT`].
      // Defaults to `NEVER`.
      //  
      active = 'ALWAYS'

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

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

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

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

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

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

      // 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__'
    }
  }
}

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.

System Property Environment Variable

active

jreleaser.announce.sdkman.active

JRELEASER_ANNOUNCE_SDKMAN_ACTIVE

consumerKey

jreleaser.announce.sdkman.consumer.key
jreleaser.sdkman.consumer.key

JRELEASER_ANNOUNCE_SDKMAN_CONSUMER_KEY
JRELEASER_SDKMAN_CONSUMER_KEY

consumerToken

jreleaser.announce.sdkman.consumer.token
jreleaser.sdkman.consumer.token

JRELEASER_ANNOUNCE_SDKMAN_CONSUMER_TOKEN
JRELEASER_SDKMAN_CONSUMER_TOKEN

Requirements

This announcer has the following requirements:

  • No snapshot releases are supported.

  • 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 a distribution or artifact by defining an extra property named skipSdkman with a true value.

  • Announcing 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.

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.