= Sdkman

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

include::partial$legend.adoc[]

[tabs]
====
YAML::
+
[source,yaml]
[subs="+macros"]
----
announce:
  # icon:dot-circle[]
  sdkman:

    # Enable or disable this announcer.
    # Valid values are [`NEVER`, `ALWAYS`, `RELEASE`, `SNAPSHOT`].
    # Defaults to `NEVER`.
    # icon:dot-circle[]
    active: ALWAYS

    # Defines the connection timeout in seconds.
    # Defaults to `20`.
    # icon:dot-circle[]
    connectTimeout: 20

    # Defines the read timeout in seconds.
    # Defaults to `60`.
    # icon:dot-circle[]
    readTimeout: 60

    # The name of the candidate registered in thew SdkMan! database.
    # If unspecified, will use ${project.name}.
    # icon:dot-circle[]
    candidate: app

    # Announce a major release if `true`, minor release if `false`.
    # Defaults to `true`.
    # icon:dot-circle[]
    major: true

    # The consumer key for publishing to SdkMan!.
    # If left unspecified, the `JRELEASER_SDKMAN_CONSUMER_KEY`
    # environment variable must be defined.
    # icon:exclamation-triangle[] icon:eye-slash[]
    consumerKey: __DO_NOT_SET_HERE__

    # The consumer token for publishing to SdkMan!.
    # If left unspecified, the `JRELEASER_SDKMAN_CONSUMER_TOKEN`
    # environment variable must be defined.
    # icon:exclamation-triangle[] icon:eye-slash[]
    consumerToken: __DO_NOT_SET_HERE__

    # Additional properties used when evaluating templates.
    # icon:dot-circle[] icon:file-alt[]
    extraProperties:
      # Key will be capitalized and prefixed with `sdkman`, i.e, `sdkmanFoo`.
      foo: bar
----
TOML::
+
[source,toml]
[subs="+macros"]
----
# icon:dot-circle[]
[announce.sdkman]

  # Enable or disable this announcer.
  # Valid values are [`NEVER`, `ALWAYS`, `RELEASE`, `SNAPSHOT`].
  # Defaults to `NEVER`.
  # icon:dot-circle[]
  active = "ALWAYS"

  # Defines the connection timeout in seconds.
  # Defaults to `20`.
  # icon:dot-circle[]
  connectTimeout = 20

  # Defines the read timeout in seconds.
  # Defaults to `60`.
  # icon:dot-circle[]
  readTimeout = 60

  # The name of the candidate registered in thew SdkMan! database.
  # If unspecified, will use ${project.name}.
  # icon:dot-circle[]
  candidate = "app"

  # Announce a major release if `true`, minor release if `false`.
  # Defaults to `true`.
  # icon:dot-circle[]
  major = true

  # The consumer key for publishing to SdkMan!.
  # If left unspecified, the `JRELEASER_SDKMAN_CONSUMER_KEY`
  # environment variable must be defined.
  # icon:exclamation-triangle[] icon:eye-slash[]
  consumerKey = "__DO_NOT_SET_HERE__"

  # The consumer token for publishing to SdkMan!.
  # If left unspecified, the `JRELEASER_SDKMAN_CONSUMER_TOKEN`
  # environment variable must be defined.
  # icon:exclamation-triangle[] icon:eye-slash[]
  consumerToken = "__DO_NOT_SET_HERE__"

  # Additional properties used when evaluating templates.
  # icon:dot-circle[] icon:file-alt[]
  extraProperties.foo = "bar"
  # Key will be capitalized and prefixed with `sdkman`, i.e, `sdkmanFoo`.
----
JSON::
+
[source,json]
[subs="+macros"]
----
{
  // icon:dot-circle[]
  "announce": {
    // icon:dot-circle[]
    "sdkman": {
      // Enable or disable this announcer.
      // Valid values are [`NEVER`, `ALWAYS`, `RELEASE`, `SNAPSHOT`].
      // Defaults to `NEVER`.
      // icon:dot-circle[]
      "active": "ALWAYS",

      // Defines the connection timeout in seconds.
      // Defaults to `20`.
      // icon:dot-circle[]
      "connectTimeout": 20,

      // Defines the read timeout in seconds.
      // Defaults to `60`.
      // icon:dot-circle[]
      "readTimeout": 60,

      // The name of the candidate registered in thew SdkMan! database.
      // If unspecified, will use ${project.name}.
      // icon:dot-circle[]
      "candidate": "app",

      // Announce a major release if `true`, minor release if `false`.
      // Defaults to `true`.
      // icon:dot-circle[]
      "major": true,

      // The consumer key for publishing to SdkMan!.
      // If left unspecified, the `JRELEASER_SDKMAN_CONSUMER_KEY`
      // environment variable must be defined.
      // icon:exclamation-triangle[] icon:eye-slash[]
      "consumerKey": "__DO_NOT_SET_HERE__",

      // The consumer token for publishing to SdkMan!.
      // If left unspecified, the `JRELEASER_SDKMAN_CONSUMER_TOKEN`
      // environment variable must be defined.
      // icon:exclamation-triangle[] icon:eye-slash[]
      "consumerToken": "__DO_NOT_SET_HERE__",

      // Additional properties used when evaluating templates.
      // icon:dot-circle[] icon:file-alt[]
      "extraProperties": {
        // Key will be capitalized and prefixed with `sdkman`, i.e, `sdkmanFoo`.
        "foo": "bar"
      }
    }
  }
}
----
Maven::
+
[source,xml]
[subs="+macros,verbatim"]
----
<jreleaser>
  <!--
    icon:dot-circle[]
  -->
  <announce>
    <!--
      icon:dot-circle[]
    -->
    <sdkman>
      <!--
        Enable or disable this announcer.
        Valid values are [`NEVER`, `ALWAYS`, `RELEASE`, `SNAPSHOT`].
        Defaults to `NEVER`.
        icon:dot-circle[]
      -->
      <active>ALWAYS</active>

      <!--
        Defines the connection timeout in seconds.
        Defaults to `20`.
        icon:dot-circle[]
      -->
      <connectTimeout>20</connectTimeout>

      <!--
        Defines the read timeout in seconds.
        Defaults to `60`.
        icon:dot-circle[]
      -->
      <readTimeout>60</readTimeout>

      <!--
        The name of the candidate registered in thew SdkMan! database.
        If unspecified, will use ${project.name}.
        icon:dot-circle[]
      -->
      <candidate>app</candidate>

      <!--
        Announce a major release if `true`, minor release if `false`.
        Defaults to `true`.
        icon:dot-circle[]
      -->
      <major>true</major>

      <!--
        The consumer key for publishing to SdkMan!.
        If left unspecified, the `JRELEASER_SDKMAN_CONSUMER_KEY`
        environment variable must be defined.
        icon:exclamation-triangle[] icon:eye-slash[]
      -->
      <consumerKey>__DO_NOT_SET_HERE__</consumerKey>

      <!--
        The consumer token for publishing to SdkMan!.
        If left unspecified, the `JRELEASER_SDKMAN_CONSUMER_TOKEN`
        environment variable must be defined.
        icon:exclamation-triangle[] icon:eye-slash[]
      -->
      <consumerToken>__DO_NOT_SET_HERE__</consumerToken>

      <!--
        Additional properties used when evaluating templates.
        icon:dot-circle[] icon:file-alt[]
      -->
      <extraProperties>
        <!--
          Key will be capitalized and prefixed with `sdkman`, i.e, `sdkmanFoo`.
        -->
        <foo>bar</foo>
      </extraProperties>
    </sdkman>
  </announce>
</jreleaser>
----
Gradle::
+
[source,groovy]
[subs="+macros"]
----
jreleaser {
  announce {
    // icon:dot-circle[]
    sdkman {
      // Enable or disable this announcer.
      // Valid values are [`NEVER`, `ALWAYS`, `RELEASE`, `SNAPSHOT`].
      // Defaults to `NEVER`.
      // icon:dot-circle[]
      active = 'ALWAYS'

      // Defines the connection timeout in seconds.
      // Defaults to `20`.
      // icon:dot-circle[]
      connectTimeout = 20

      // Defines the read timeout in seconds.
      // Defaults to `60`.
      // icon:dot-circle[]
      readTimeout = 60

      // The name of the candidate registered in thew SdkMan! database.
      // If unspecified, will use ${project.name}.
      // icon:dot-circle[]
      candidate = 'app'

      // Announce a major release if `true`, minor release if `false`.
      // Defaults to `true`.
      // icon:dot-circle[]
      major = true

      // The consumer key for publishing to SdkMan!.
      // If left unspecified, the `JRELEASER_SDKMAN_CONSUMER_KEY`
      // environment variable must be defined.
      // icon:exclamation-triangle[] icon:eye-slash[]
      consumerKey = "__DO_NOT_SET_HERE__"

      // The consumer token for publishing to SdkMan!.
      // If left unspecified, the `JRELEASER_SDKMAN_CONSUMER_TOKEN`
      // environment variable must be defined.
      // icon:exclamation-triangle[] icon:eye-slash[]
      consumerToken = "__DO_NOT_SET_HERE__"

      // Additional properties used when evaluating templates.
      // Key will be capitalized and prefixed with `sdkman`, i.e, `sdkmanFoo`.
      // icon:dot-circle[] icon:file-alt[]
      extraProperties.put('foo', 'bar')
    }
  }
}
----
====


This announcer has the following considerations:

* 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 by defining an extra property named `sdkmanSkip` with any value.
* Announcing will be skipped if no suitable artifacts are found.

Supported platform values are:

* `mac`, `osx`.
* `win`, `windows`.
* `linux`.

