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.

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.${git}.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.
    # If left unspecified, the `JRELEASER_SDKMAN_CONSUMER_KEY`
    # environment variable must be defined.
    #  
    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.
    #  
    consumerToken: __DO_NOT_SET_HERE__
# 
[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.${git}.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.
  # If left unspecified, the `JRELEASER_SDKMAN_CONSUMER_KEY`
  # environment variable must be defined.
  #  
  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.
  #  
  consumerToken = "__DO_NOT_SET_HERE__"
{
  // 
  "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.${git}.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.
      // If left unspecified, the `JRELEASER_SDKMAN_CONSUMER_KEY`
      // environment variable must be defined.
      //  
      "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.
      //  
      "consumerToken": "__DO_NOT_SET_HERE__"
    }
  }
}
<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.${git}.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.
        If left unspecified, the `JRELEASER_SDKMAN_CONSUMER_KEY`
        environment variable must be defined.
         
      -->
      <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.
         
      -->
      <consumerToken>__DO_NOT_SET_HERE__</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.${git}.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.
      // If left unspecified, the `JRELEASER_SDKMAN_CONSUMER_KEY`
      // environment variable must be defined.
      //  
      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.
      //  
      consumerToken = '__DO_NOT_SET_HERE__'
    }
  }
}

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.

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.${git}.skipRelease is false then use the releaser’s downloadUrl.

  7. if releaser.${git}.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.