Http

Downloads artifacts, files, and signatures from an HTTP/HTTPS server.

Legend:

  • required

  • optional

  • may use environment variable

  • accepts Name Templates

  • YAML

  • TOML

  • JSON

  • Maven

  • Gradle

# 
download:
  # 
  http:
    # Downloaders require a name.
    # 
    app:

      # Enables or disables the downloader.
      # 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 `http`, i.e, `httpFoo`.
        foo: bar

      # The username required for authorization.
      # If left unspecified, the `JRELEASER_HTTP_${name}_USERNAME`
      # environment variable must be defined.
      #  
      username: __DO_NOT_SET_HERE__

      # Password for login into the repository.
      # If left unspecified, the `JRELEASER_HTTP_${name}_PASSWORD`
      # environment variable must be defined.
      #  
      password: __DO_NOT_SET_HERE__

      # The authorization method to use.
      # Supported values are [`NONE`, `BASIC`, `BEARER`].
      # `Basic` requires both username & password.
      # `BEARER` requires a token (set as password).
      # Defaults to `NONE`.
      # 
      authorization: BASIC

      # A list of assets to be downloaded.
      # 
      assets:
          # Full download path to asset.
          #  
        - input: 'https://artifacts.acme.com/logos/logo-256x256.png'

          # Local path where asset will be downloaded to.
          # Defaults to `${jreleaser.downloadDirectory}/${downloader.name}`.
          #  
          output: '{{projectName}}.png'

          # Unpack options
          # 
          unpack:
            # Unpack input archive when `true`.
            # Defaults to `false`.
            # 
            enabled: false

            # Skip the archive's root entry from the unpacked directory when `true`.
            # Defaults to `false`.
            # 
            skipRootEntry: false
# Downloaders require a name.
# 
[download.http.app]

  # Enables or disables the downloader.
  # 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 `http`, i.e, `httpFoo`.

  # The username required for authorization.
  # If left unspecified, the `JRELEASER_HTTP_${name}_USERNAME`
  # environment variable must be defined.
  #  
  username = "__DO_NOT_SET_HERE__"

  # Password for login into the repository..
  # If left unspecified, the `JRELEASER_HTTP_${name}_PASSWORD`
  # environment variable must be defined.
  #  
  password = "__DO_NOT_SET_HERE__"

  # The authorization method to use.
  # Supported values are [`NONE`, `BASIC`, `BEARER`].
  # `Basic` requires both username & password.
  # `BEARER` requires a token (set as password).
  # Defaults to `NONE`.
  # 
  authorization = "BASIC"

  # A list of assets to be downloaded.
  # 
  [[dowload.http.app.assets]]
    # Full download path to asset.
    #  
    input = "https://artifacts.acme.com/logos/logo-256x256.png"

    # Local path where asset will be downloaded to.
    # Defaults to `${jreleaser.downloadDirectory}/${downloader.name}`.
    #  
    output = "{{projectName}}.png"

    # Unpack input archive when `true`.
    # Defaults to `false`.
    # 
    unpack.enabled: false

    # Skip the archive's root entry from the unpacked directory when `true`.
    # Defaults to `false`.
    # 
    unpack.skipRootEntry: false
{
  // 
  "download": {
    // 
    "http": {
      // Downloaders require a name.
      // 
      "app": {

        // Enables or disables the downloader.
        // 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 `http`, i.e, `httpFoo`.
          "foo": "bar"
        },

        // The username required for authorization.
        // If left unspecified, the `JRELEASER_HTTP_${name}_USERNAME`
        // environment variable must be defined.
        //  
        "username": "__DO_NOT_SET_HERE__",

        // Password for login into the repository.
        // If left unspecified, the `JRELEASER_HTTP_${name}_PASSWORD`
        // environment variable must be defined.
        //  
        "password": "__DO_NOT_SET_HERE__",

        // The authorization method to use.
        // Supported values are [`NONE`, `BASIC`, `BEARER`].
        // `Basic` requires both username & password.
        // `BEARER` requires a token (set as password).
        // Defaults to `NONE`.
        // 
        "authorization": "BASIC",

        // A list of assets to be downloaded.
        // 
        "assets": [
          {
            // Full download path to asset.
            //  
            "input": "https://artifacts.acme.com/logos/logo-256x256.png",

            // Local path where asset will be downloaded to.
            // Defaults to `${jreleaser.downloadDirectory}/${downloader.name}`.
            //  
            "output": "{{projectName}}.png",

            // Unpack options
            // 
            "unpack": {
              // Unpack input archive when `true`.
              // Defaults to `false`.
              // 
              "enabled": false,

              // Skip the archive's root entry from the unpacked directory when `true`.
              // Defaults to `false`.
              // 
              "skipRootEntry": false
            }
          }
        ]
      }
    }
  }
}
<jreleaser>
  <!--
    
  -->
  <download>
    <!--
      
    -->
    <http>
      <!--
        Downloaders require a name.
        
      -->
      <app>
        <!--
          Enables or disables the distribution.
          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 `http`, i.e, `httpFoo`.
          -->
          <foo>bar</foo>
        </extraProperties>

        <!--
          The username required for authorization.
          If left unspecified, the `JRELEASER_HTTP_${name}_USERNAME`
          environment variable must be defined.
           
        -->
        <username>__DO_NOT_SET_HERE__</username>

        <!--
          Password for login into the repository.
          If left unspecified, the `JRELEASER_HTTP_${name}_PASSWORD`
          environment variable must be defined.
           
        -->
        <password>__DO_NOT_SET_HERE__</password>

        <!--
          The authorization method to use.
          Supported values are [`NONE`, `BASIC`, `BEARER`].
          `Basic` requires both username & password.
          `BEARER` requires a token (set as password).
          Defaults to `NONE`.
          
        -->
        <authorization>BASIC</authorization>

        <!--
          A list of assets to be downloaded.
          
        -->
        <assets>
          <asset>
            <!--
              Full download path to asset.
               
            -->
            <input>https://artifacts.acme.com/logos/logo-256x256.png</input>;

            <!--
              Local path where asset will be downloaded to.
              Defaults to `${jreleaser.downloadDirectory}/${downloader.name}`.
               
            -->
            <output>{{projectName}}.png</output>

            <!--
              Unpack options
              
            -->
            <unpack>
              <!--
                Unpack input archive when `true`.
                Defaults to `false`.
                
              -->
              <enabled>false</enabled>

              <!--
                Skip the archive's root entry from the unpacked directory when `true`.
                Defaults to `false`.
                
              -->
              <skipRootEntry>false</skipRootEntry>
            </unpack>
          </asset>
        </assets>
      </app>
    </http>
  </download>
</jreleaser>
jreleaser {
  // 
  download {
    // 
    http {
      // Downloaders require a name.
      // 
      app {

        // Enables or disables the downloader.
        // 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 `http`, i.e, `httpFoo`.
        // 
        extraProperties.put('foo', 'bar')

        // The username required for authorization.
        // If left unspecified, the `JRELEASER_HTTP_${name}_USERNAME`
        // environment variable must be defined.
        //  
        username = '__DO_NOT_SET_HERE__'

        // Password for login into the repository.
        // If left unspecified, the `JRELEASER_HTTP_${name}_PASSWORD`
        // environment variable must be defined.
        //  
        password = '__DO_NOT_SET_HERE__'

        // The authorization method to use.
        // Supported values are [`NONE`, `BASIC`, `BEARER`].
        // `Basic` requires both username & password.
        // `BEARER` requires a token (set as password).
        // Defaults to `NONE`.
        // 
        authorization = 'BASIC'

        // A list of assets to be downloaded.
        // 
        asset {
          // Full download path to asset.
          //  
          input = 'https://artifacts.acme.com/logos/logo-256x256.png'

          // Local path where asset will be downloaded to.
          // Defaults to `${jreleaser.downloadDirectory}/${downloader.name}`.
          //  
          output = '{{projectName}}.png'

          // Unpack options
          // 
          unpack {
            // Unpack input archive when `true`.
            // Defaults to `false`.
            // 
            enabled = false

            // Skip the archive's root entry from the unpacked directory when `true`.
            // Defaults to `false`.
            // 
            skipRootEntry = false
          }
       }
      }
    }
  }
}

Username

You can have the username set in the configuration as shown above, or you can have it read from an environment variable. The configured name of the HTTP server will be used to build the environment variable name. This means that the name per configured instance needs to be unique.

The name of the environment variable will be JRELEASER_HTTP_NAME_USERNAME. If your instance is named production, you can store the username in the environment variable JRELEASER_HTTP_PRODUCTION_USERNAME. The name will be transformed to uppercase.

If a configured username is found in the configuration file, then the environment variable is not used at all.

Password

The password will be stored in an environment variable. The configured name of the HTTP server will be used. This means that the name per configured instance needs to be unique.

The name of the environment variable will be JRELEASER_HTTP_NAME_PASSWORD. If your instance is named production, you need to store the secret in the environment variable JRELEASER_HTTP_PRODUCTION_PASSWORD. The name will be transformed to uppercase.

Example

download:
  http:
    my_downloader:
      assets:
        - input: https://github.com/jreleaser/jreleaser/raw/main/src/media/icon_256x256.png
          output: '{{projectName}}.png'
        - input: https://github.com/jreleaser/jreleaser/releases/download/v1.0.0/jreleaser-{{projectVersion}}.zip
          unpack:
            enabled: true