Checksum

JReleaser calculates checksums for all input files and artifacts. These checksums are grouped into a single file named checksums_<algorithm>.txt which in turn may be signed and uploaded to a release.

Use the following options to customize how checksums are handled:

Legend:

  • required

  • optional

  • may use environment variable

  • accepts Name Templates

  • YAML

  • TOML

  • JSON

  • Maven

  • Gradle

# 
checksum:
  # The name of the grouping checksums file.
  # Defaults to `checksums.txt`.
  #  
  name: '{{projectName}}-{{projectVersion}}_checksums.txt'

  # Algorithm to be used.
  # Valid values are [`MD2`, `MD5`, `SHA1`, `SHA256`, `SHA384`, `SHA512`, `SHA3-224`, `SHA3-256`, `SHA3-384`, `SHA3-512`].
  # Default value is `SHA256`.
  # `SHA256` is always configured.
  # 
  algorithms:
    - MD5
    - SHA256

  # Uploads individual checksum files.
  # Defaults to `false`.
  # 
  individual: true

  # Whether to checksum files in the `files` section or not.
  # Defaults to `true`.
  # 
  files: true
# 
[checksum]
  # The name of the grouping checksums file.
  # Defaults to `checksums.txt`.
  #  
  name = "{{projectName}}-{{projectVersion}}_checksums.txt"

  # Algorithm to be used.
  # Valid values are [`MD2`, `MD5`, `SHA1`, `SHA256`, `SHA384`, `SHA512`, `SHA3-224`, `SHA3-256`, `SHA3-384`, `SHA3-512`].
  # Default value is `SHA256`.
  # `SHA256` is always configured.
  # 
  algorithms = ["MD5", "SHA256"]

  # Uploads individual checksum files.
  # Defaults to `false`.
  # 
  individual = true

  # Whether to checksum files in the `files` section or not.
  # Defaults to `true`.
  # 
  files = true
{
  // 
  "checksum": {

    // The name of the grouping checksums file.
    // Defaults to `checksums.txt`.
    //  
    "name": "{{projectName}}-{{projectVersion}}_checksums.txt",

    // Algorithm to be used.
    // Valid values are [`MD2`, `MD5`, `SHA1`, `SHA256`, `SHA384`, `SHA512`, `SHA3-224`, `SHA3-256`, `SHA3-384`, `SHA3-512`].
    // Default value is `SHA256`.
    // `SHA256` is always configured.
    // 
    "algorithms": [
      "MD5",
      "SHA256"
    ],

    // Uploads individual checksum files.
    // Defaults to `false`.
    // 
    "individual": true,

    // Whether to checksum files in the `files` section or not.
    // Defaults to `true`.
    // 
    "files": true
  }
}
<jreleaser>
  <!--
    
  -->
  <checksum>

    <!--
      The name of the grouping checksums file.
      Defaults to `checksums.txt`.
       
    -->
    <name>{{projectName}}-{{projectVersion}}_checksums.txt</name>

    <!--
      Algorithm to be used.
      Valid values are [`MD2`, `MD5`, `SHA1`, `SHA256`, `SHA384`, `SHA512`, `SHA3-224`, `SHA3-256`, `SHA3-384`, `SHA3-512`].
      Default value is `SHA256`.
      `SHA256` is always configured.
      
    -->
    <algorithms>
        <algorithm>MD5</algorithm>
        <algorithm>SHA256</algorithm>
    </algorithms>

    <!--
      Uploads individual checksum files.
      Defaults to `false`.
      
    -->
    <individual>true</individual>

    <!--
      Whether to checksum files in the `files` section or not.
      Defaults to `true`.
      
    -->
    <files>true</files>
  </checksum>
</jreleaser>
jreleaser {
  // 
  checksum {
    // The name of the grouping checksums file.
    // Defaults to `checksums.txt`.
    //  
    name = '{{projectName}}-{{projectVersion}}_checksums.txt'

    // Algorithm to be used.
    // Valid values are [`MD2`, `MD5`, `SHA1`, `SHA256`, `SHA384`, `SHA512`, `SHA3-224`, `SHA3-256`, `SHA3-384`, `SHA3-512`].
    // Default value is `SHA256`.
    // `SHA256` is always configured.
    // 
    algorithm('MD5')
    algorithm('SHA256')

    // Uploads individual checksum files.
    // Defaults to `false`.
    // 
    individual = true

    // Whether to checksum files in the `files` section or not.
    // Defaults to `true`.
    // 
    files = true
  }
}

Extra Properties

Both Distributions and Artifacts may define an extra property named "individualChecksum". If the value is set to true then the checksums for the given element will also be added to the release files.

The precedence rules are:

  • If the Artifact has a property "individualChecksum":

    • if the property resolves to true then the individual checksum is released.

    • if the property resolves to false then the individual checksum is skipped and no more rules are checked.

  • If the Distribution has a property "individualChecksum":

    • if the property resolves to true then individual checksums for all its artifacts are released.

    • if the property resolves to false then all of its individual checksums are skipped and no more rules are checked.

  • If the checksum.individual property is set:

    • if the property resolves to true then individual checksums are released.

    • if the property resolves to false then no individual checksums are released.

Skip Checksum

Artifacts and globs in the Files section may define an extra property will prevent checksum calculation. The name of this property must match skipChecksum and be set to true.