Distributions

Distributions define artifacts that may be published using supported packages and announced with supported announcers.

Each distribution is responsible for defining a unique name and a list of artifacts that belong to it.

A distribution requires at least 1 artifact to be listed.

Distributions inherit the configuration specified in the Packagers block and may override it.

Legend:

  • required

  • optional

  • may use environment variable

  • accepts Name Templates

  • YAML

  • TOML

  • JSON

  • Maven

  • Gradle

# 
distributions:
  # A named distribution
  # 
  app:

    # Enables or disables the distribution.
    # Valid values are [`NEVER`, `ALWAYS`, `RELEASE`, `SNAPSHOT`].
    # Defaults to `ALWAYS`.
    # 
    active: ALWAYS

    # The distribution type.
    # Used to determine packager templates.
    # Supported values are: [JAVA_BINARY, SINGLE_JAR, JLINK, NATIVE_IMAGE].
    # 
    type: JAVA_BINARY

    # Name of the executable launcher.
    # If left undefined, will use ${distribution.name}.
    # 
    executable: app

    # A list of tags.
    # 
    tags:
      - cli
      - awesome

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

    # A list of artifacts.
    # At least on entry must be present.
    #  
    artifacts:
      - path: path/to/{{distributionName}}-{{projectVersion}}.zip
      - path: path/to/{{distributionName}}-{{projectVersion}}-mac.zip
        platform: osx
      - path: path/to/{{distributionName}}-{{projectVersion}}-win.zip
        platform: windows

    # 
    java:
      # Maven coordinates: groupId.
      # If left undefined, will use ${project.java.groupId}.
      # 
      groupId: com.acme

      # Maven coordinates: artifactId.
      # If left undefined, will use ${project.java.artifactId}.
      # 
      artifactId: app

      # The minimum Java version required by consumers to run the application.
      # If left undefined, will use ${project.java.version}.
      # 
      version: 8

      # The application's entry point.
      # If left undefined, will use ${project.java.mainClass}.
      # 
      mainClass: com.acme.Main

      # Identifies the project as being member of a multi-project build.
      # If left undefined, will use ${project.java.multiProject}.
      # 
      multiProject: false

      # Additional properties used when evaluating templates.
      # 
      extraProperties:
        # Key will be capitalized and prefixed with `java`, i.e, `javaFoo`.
        foo: bar
# A named distribution
# 
[distributions.app]

  # Enables or disables the distribution.
  # Valid values are [`NEVER`, `ALWAYS`, `RELEASE`, `SNAPSHOT`].
  # Defaults to `ALWAYS`.
  # 
  active = "ALWAYS"

  # The distribution type.
  # Used to determine packager templates.
  # Supported values are: [JAVA_BINARY, SINGLE_JAR, JLINK, NATIVE_IMAGE].
  # 
  type = "JAVA_BINARY"

  # Name of the executable launcher.
  # If left undefined, will use ${distribution.name}.
  # 
  executable = "app"

  # A list of tags.
  # 
  tags = ["cli", "awesome"]

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

  # A list of artifacts.
  # At least on entry must be present.
  #  
  artifacts = [
    { path = "path/to/{{distributionName}}-{{projectVersion}}.zip" },
    { path = "path/to/{{distributionName}}-{{projectVersion}}-mac.zip", platform = "osx" },
    { path = "path/to/{{distributionName}}-{{projectVersion}}-win.zip", platform = "windows" }
  ]

  # Maven coordinates: groupId.
  # If left undefined, will use ${project.java.groupId}.
  # 
  java.groupId = "com.acme"

  # Maven coordinates: artifactId.
  # If left undefined, will use ${project.java.artifactId}.
  # 
  java.artifactId = "app"

  # The minimum Java version required by consumers to run the application.
  # If left undefined, will use ${project.java.version}.
  # 
  java.version = "8"

  # The application's entry point.
  # If left undefined, will use ${project.java.mainClass}.
  # 
  java.mainClass = "com.acme.Main"

  # Identifies the project as being member of a multi-project build.
  # If left undefined, will use ${project.java.multiProject}.
  # 
  java.multiProject = false

  # Additional properties used when evaluating templates.
  # 
  java.extraProperties.foo = "bar"
  # Key will be capitalized and prefixed with `java`, i.e, `javaFoo`.
{
  // 
  "distributions": {
    // A named distribution
    // 
    "app": {

      // Enables or disables the distribution.
      // Valid values are [`NEVER`, `ALWAYS`, `RELEASE`, `SNAPSHOT`].
      // Defaults to `ALWAYS`.
      // 
      "active": "ALWAYS",

      // The distribution type.
      // Used to determine packager templates.
      // Supported values are: [JAVA_BINARY, SINGLE_JAR, JLINK, NATIVE_IMAGE].
      // 
      "type": "JAVA_BINARY",

      // Name of the executable launcher.
      // If left undefined, will use ${distribution.name}.
      // 
      "executable": "app",

      // A list of tags.
      // 
      "tags": [
         "cli",
         "awesome"
      ],

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

      // A list of artifacts.
      // At least on entry must be present.
      //  
      "artifacts": [
        {
          "path": "path/to/{{distributionName}}-{{projectVersion}}.zip"
        },
        {
          "path": "path/to/{{distributionName}}-{{projectVersion}}-mac.zip",
          "platform": "osx"
        },
        {
          "path": "path/to/{{distributionName}}-{{projectVersion}}-win.zip",
          "platform": "windows"
        }
      ],

      // 
      "java": {
        // Maven coordinates: groupId.
        // If left undefined, will use ${project.java.groupId}.
        // 
        "groupId": "com.acme",

        // Maven coordinates: artifactId.
        // If left undefined, will use ${project.java.artifactId}.
        // 
        "artifactId": "app",

        // The minimum Java version required by consumers to run the application.
        // If left undefined, will use ${project.java.version}.
        // 
        "version": "8",

        // The application's entry point.
        // If left undefined, will use ${project.java.mainClass}.
        // 
        "mainClass": "com.acme.Main",

        // Identifies the project as being member of a multi-project build.
        // If left undefined, will use ${project.java.multiProject}.
        // 
        "multiProject": false,

        // Additional properties used when evaluating templates.
        // 
        "extraProperties": {
          // Key will be capitalized and prefixed with `java`, i.e, `javaFoo`.
          "foo": "bar"
        }
      }
    }
  }
}
<jreleaser>
  <!--
    
  -->
  <distributions>
    <!--
      A named distribution
      
    -->
    <app>

      <!--
        Enables or disables the distribution.
        Valid values are [`NEVER`, `ALWAYS`, `RELEASE`, `SNAPSHOT`].
        Defaults to `ALWAYS`.
        
      -->
      <active>ALWAYS</active>

      <!--
        The distribution type.
        Used to determine packager templates.
        Supported values are>[JAVA_BINARY, SINGLE_JAR, JLINK, NATIVE_IMAGE].
        
      -->
      <type>JAVA_BINARY</type>

      <!--
        Name of the executable launcher.
        If left undefined, will use ${distribution.name}.
        
      -->
      <executable>app</executable>

      <!--
        A list of tags.
        
      -->
      <tags>
        <tag>cli</tag>
        <tag>awesome</tag>
      </tags>

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

      <!--
        A list of artifacts.
        At least on entry must be present.
         
      -->
      <artifacts>
        <artifact>
          <path>path/to/${project.artifactId}-${project.version}.zip</path>
        </artifact>
        <artifact>
          <path>path/to/${project.artifactId}-${project.version}-mac.zip</path>
          <platform>osx</platform>
        </artifact>
        <artifact>
          <path>path/to/${project.artifactId}-${project.version}-win.zip</path>
          <platform>windows</platform>
        </artifact>
      </artifacts>

      <!--
        
      -->
      <java>
        <!--
          Maven coordinates>groupId.
          If left undefined, will use ${project.java.groupId}.
          
        -->
        <groupId>com.acme</groupId>

        <!--
          Maven coordinates>artifactId.
          If left undefined, will use ${project.java.artifactId}.
          
        -->
        <artifactId>app</artifactId>

        <!--
          The minimum Java version required by consumers to run the application.
          If left undefined, will use ${project.java.version}.
          
        -->
        <version>8</version>

        <!--
          The application's entry point.
          If left undefined, will use ${project.java.mainClass}.
          
        -->
        <mainClass>com.acme.Main</mainClass>

        <!--
          Identifies the project as being member of a multi-project build.
          If left undefined, will use ${project.java.multiProject}.
          
        -->
        <multiProject>false</multiProject>

        <!--
          Additional properties used when evaluating templates.
          
        -->
        <extraProperties>
          <!--
            Key will be capitalized and prefixed with `java`, i.e, `javaFoo`.
          -->
          <foo>bar</foo>
        </extraProperties>
      </java>
    </app>
  </distributions>
</jreleaser>
jreleaser {
  // 
  distributions {
    // A named distribution
    // 
    app {

      // Enables or disables the distribution.
      // Valid values are [`NEVER`, `ALWAYS`, `RELEASE`, `SNAPSHOT`].
      // Defaults to `ALWAYS`.
      // 
      active = 'ALWAYS'

      // The distribution type.
      // Used to determine packager templates.
      // Supported values are = [JAVA_BINARY, SINGLE_JAR, JLINK, NATIVE_IMAGE].
      // 
      distributionType = 'JAVA_BINARY'

      // Name of the executable launcher.
      // If left undefined, will use ${distribution.name}.
      // 
      executable = 'app'

      // A list of tags.
      // 
      tags = ['cli', 'awesome']

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

      // A list of artifacts.
      // At least on entry must be present.
      //  
      artifacts {
        artifact {
          path = "path/to/${project.name}-${project.version}.zip"
        }
        artifact {
          path = "path/to/${project.name}-${project.version}-mac.zip"
          platform = 'osx'
        }
        artifact {
          path = "path/to/${project.name}-${project.version}-win.zip"
          platform = 'windows'
        }
      }

      // 
      java {
        // Maven coordinates = groupId.
        // If left undefined, will use ${project.java.groupId}.
        // 
        groupI = 'com.acme'

        // Maven coordinates = artifactId.
        // If left undefined, will use ${project.java.artifactId}.
        // 
        artifactId = 'app'

        // The minimum Java version required by consumers to run the application.
        // If left undefined, will use ${project.java.version}.
        // 
        version = '8'

        // The application's entry point.
        // If left undefined, will use ${project.java.mainClass}.
        // 
        mainClass = 'com.acme.Main'

        // Identifies the project as being member of a multi-project build.
        // If left undefined, will use ${project.java.multiProject}.
        // 
        multiProject = false

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

It’s recommended to list universal artifacts first, then platform specific.

The value of platform is dictated by the normalized values detected by os-maven-plugin. You may use the plain platform value or append a arch classifier. The following values are currently recognized:

platform

aix, hpux, os400, linux, linux_musl, osx, freebsd, openbsd, netbsd, sunos, windows, zos.

arch

x86_64, x86_32, itanium_64, itanium_32, sparc_32, sparc_64, arm_32, aarch_64, mips_32, mipsel_32, mips_64, mipsel_64, ppc_32, ppcle_32, ppc_64, ppcle_64, s390_32, s390_64, riscv

Examples:

  • osx

  • osx-arm

  • windows

  • linux

  • linux-x86_64

Use linux_musl for artifacts that target Alpine Linux.