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

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

Legend:

  • required

  • optional

  • may use environment variable

  • accepts Name Templates

  • YAML

  • TOML

  • JSON

  • Maven

  • Gradle

# 
packagers:
  # 
  sdkman:
    # Enables or disables Sdkman.
    # Valid 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.
    # Valid 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}}

    # 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__
# 
[packagers.sdkman]
  # Enables or disables Sdkman.
  # Valid 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 ${project.name}.
  # 
  candidate = "app"

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

  # Sdkman command to use.
  # Valid 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__"
{
  // 
  "packagers": {
    // 
    "sdkman": {
      // Enables or disables Sdkman.
      // Valid 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 ${project.name}.
      // 
      "candidate": "app",

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

      // Sdkman command to use.
      // Valid 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>
  <!--
    
  -->
  <packagers>
    <!--
      
    -->
    <sdkman>
      <!--
        Enables or disables Sdkman.
        Valid 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 ${project.name}.
        
      -->
      <candidate>app</candidate>

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

      <!--
        Sdkman command to use.
        Valid 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>
  </packagers>
</jreleaser>
jreleaser {
  // 
  packagers {
    // 
    sdkman {
      // Enables or disables Sdkman.
      // Valid 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 ${project.name}.
      // 
      candidate = 'app'

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

      // Sdkman command to use.
      // Valid 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__'
    }
  }
}
Candidate names must be unique!

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.

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.