Http

Uploads artifacts, files, and signatures to an HTTP/HTTPS server.

Prerequisites:
  • A HTTP/HTTPS server that accepts POST/PUT requests.

  • Username + Password/Token if authorization is required.

Configuration

Legend:

  • required

  • optional

  • may use environment variable

  • accepts Name Templates

  • YAML

  • TOML

  • JSON

  • Maven

  • Gradle

# 
upload:
  # 
  http:
    # Uploaders require a name.
    # 
    app:

      # Enables or disables the uploader.
      # 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

      # Upload files.
      # Defaults to `true`.
      # 
      files: true

      # Upload distribution artifacts.
      # Defaults to `true`.
      # 
      artifacts: true

      # Release checksum files.
      # Defaults to `true`.
      # 
      checksums: true

      # Upload signatures.
      # Defaults to `true`.
      # 
      signatures: true

      # Upload catalogs.
      # Defaults to `true`.
      # 
      catalogs: true

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

      # URL of the HTTP/HTTPS server + path + artifact.
      #  
      uploadUrl: https://my.server.com/{{projectName}}/{{tagName}}/{{artifactFile}}

      # URL of the HTTP/HTTPS server + path + artifact.
      # If undefined, will use the same value as `uploadUrl`.
      #  
      downloadUrl: https://my.server.com/{{projectName}}/{{tagName}}/{{artifactFile}}

      # The username required for authorization.
      #  
      username: __USE_ENVIRONMENT_VARIABLE__

      # Password for login into the repository.
      #  
      password: __USE_ENVIRONMENT_VARIABLE__

      # 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

      # The method to use for uploading artifacts.
      # Supported values are [`POST`, `PUT`].
      # Defaults to `PUT`.
      # 
      method: POST

      # Additional headers to be sent to the server.
      # Values accept Name Templates.
      #  
      headers:
        'X-ARTIFACT-PLATFORM': '{{artifactPlatform}}'
# Uploaders require a name.
# 
[upload.http.app]

  # Enables or disables the uploader.
  # 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

  # Upload files.
  # Defaults to `true`.
  # 
  files = true

  # Upload distribution artifacts.
  # Defaults to `true`.
  # 
  artifacts = true

  # Release checksum files.
  # Defaults to `true`.
  # 
  checksums = true

  # Upload signatures.
  # Defaults to `true`.
  # 
  signatures = true

  # Upload catalogs.
  # Defaults to `true`.
  # 
  catalogs = true

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

  # URL of the HTTP/HTTPS server + path + artifact.
  #  
  uploadUrl = "https://my.server.com/{{projectName}}/{{tagName}}/{{artifactFile}}"

  # URL of the HTTP/HTTPS server + path + artifact.
  # If undefined, will use the same value as `uploadUrl`.
  #  
  downloadUrl = "https://my.server.com/{{projectName}}/{{tagName}}/{{artifactFile}}"

  # The username required for authorization.
  #  
  username = "__USE_ENVIRONMENT_VARIABLE__"

  # Password for login into the repository.
  #  
  password = "__USE_ENVIRONMENT_VARIABLE__"

  # 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"

  # The method to use for uploading artifacts.
  # Supported values are [`POST`, `PUT`].
  # Defaults to `PUT`.
  # 
  method = "POST"

  # Additional headers to be sent to the server.
  # Values accept Name Templates.
  #  
  headers."X-ARTIFACT-PLATFORM" = "{{artifactPlatform}}"
{
  // 
  "upload": {
    // 
    "http": {
      // Uploaders require a name.
      // 
      "app": {

        // Enables or disables the uploader.
        // 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,

        // Upload files.
        // Defaults to `true`.
        // 
        "files": true,

        // Upload distribution artifacts.
        // Defaults to `true`.
        // 
        "artifacts": true,

        // Release checksum files.
        // Defaults to `true`.
        // 
        "checksums": true,

        // Upload signatures.
        // Defaults to `true`.
        // 
        "signatures": true,

        // Upload catalogs.
        // Defaults to `true`.
        // 
        "catalogs": true,

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

        // URL of the HTTP/HTTPS server + path + artifact.
        //  
        "uploadUrl": "https://my.server.com/{{projectName}}/{{tagName}}/{{artifactFile}}",

        // URL of the HTTP/HTTPS server + path + artifact.
        // If undefined, will use the same value as `uploadUrl`.
        //  
        "downloadUrl": "https://my.server.com/{{projectName}}/{{tagName}}/{{artifactFile}}",

        // The username required for authorization.
        //  
        "username": "__USE_ENVIRONMENT_VARIABLE__",

        // Password for login into the repository.
        //  
        "password": "__USE_ENVIRONMENT_VARIABLE__",

        // 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",

        // The method to use for uploading artifacts.
        // Supported values are [`POST`, `PUT`].
        // Defaults to `PUT`.
        // 
        "method": "POST",

        // Additional headers to be sent to the server.
        // Values accept Name Templates.
        //  
        "headers": {
          "X-ARTIFACT-PLATFORM": "{{artifactPlatform}}"
        }
      }
    }
  }
}
<jreleaser>
  <!--
    
  -->
  <upload>
    <!--
      
    -->
    <http>
      <!--
        Uploaders 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>

        <!--
          Upload files.
          Defaults to `true`.
          
        -->
        <files>true</files>

        <!--
          Upload distribution artifacts.
          Defaults to `true`.
          
        -->
        <artifacts>true</artifacts>

        <!--
          Release checksum files.
          Defaults to `true`.
          
        -->
        <checksums>true</checksums>

        <!--
          Upload signatures.
          Defaults to `true`.
          
        -->
        <signatures>true</signatures>

        <!--
          Upload catalogs.
          Defaults to `true`.
          
        -->
        <catalogs>true</catalogs>

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

        <!--
          URL of the HTTP/HTTPS server + path + artifact.
           
        -->
        <uploadUrl>https://my.server.com/{{projectName}}/{{tagName}}/{{artifactFile}}</uploadUrl>

        <!--
          URL of the HTTP/HTTPS server + path + artifact.
          If undefined, will use the same value as `uploadUrl`.
           
        -->
        <downloadUrl>https://my.server.com/{{projectName}}/{{tagName}}/{{artifactFile}}</downloadUrl>

        <!--
          The username required for authorization.
           
        -->
        <username>__USE_ENVIRONMENT_VARIABLE__</username>

        <!--
          Password for login into the repository.
           
        -->
        <password>__USE_ENVIRONMENT_VARIABLE__</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>

        <!--
          The method to use for uploading artifacts.
          Supported values are [`POST`, `PUT`].
          Defaults to `PUT`.
          
        -->
        <method>POST</method>

        <!--
          Additional headers to be sent to the server.
          Values accept Name Templates.
           
        -->
        <headers>
          <X-ARTIFACT-PLATFORM>{{artifactPlatform}}</X-ARTIFACT-PLATFORM>
        </headers>
      </app>
    </http>
  </upload>
</jreleaser>
jreleaser {
  // 
  upload {
    // 
    http {
      // Uploaders require a name.
      // 
      app {

        // Enables or disables the uploader.
        // 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

        // Upload files.
        // Defaults to `true`.
        // 
        files = true

        // Upload distribution artifacts.
        // Defaults to `true`.
        // 
        artifacts = true

        // Release checksum files.
        // Defaults to `true`.
        // 
        checksums = true

        // Upload signatures.
        // Defaults to `true`.
        // 
        signatures = true

        // Upload catalogs.
        // Defaults to `true`.
        // 
        catalogs = true

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

        // URL of the HTTP/HTTPS server + path + artifact.
        //  
        uploadUrl = 'https://my.server.com/{{projectName}}/{{tagName}}/{{artifactFile}}'

        // URL of the HTTP/HTTPS server + path + artifact.
        // If undefined, will use the same value as `uploadUrl`.
        //  
        downloadUrl = 'https://my.server.com/{{projectName}}/{{tagName}}/{{artifactFile}}'

        // The username required for authorization.
        //  
        username = '__USE_ENVIRONMENT_VARIABLE__'

        // Password for login into the repository.
        //  
        password = '__USE_ENVIRONMENT_VARIABLE__'

        // 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'

        // The method to use for uploading artifacts.
        // Supported values are [`POST`, `PUT`].
        // Defaults to `PUT`.
        // 
        method = 'POST'

        // Additional headers to be sent to the server.
        // Values accept Name Templates.
        //  
        headers.put('X-ARTIFACT-PLATFORM', '{{artifactPlatform}}')
      }
    }
  }
}

Environment

When not explicitly set, the value of the following properties may be resolved from an environment variable or a system property as shown in the table. The system property takes precedence over the environment variable.

System Property Environment Variable

active

jreleaser.upload.http.${name}.active
jreleaser.upload.http.active

JRELEASER_UPLOAD_HTTP_${name}_ACTIVE
JRELEASER_UPLOAD_HTTP_ACTIVE

username

jreleaser.upload.http.${name}.username
jreleaser.upload.http.username
jreleaser.http.${name}.username
jreleaser.http.username

JRELEASER_UPLOAD_HTTP_${name}_USERNAME
JRELEASER_UPLOAD_HTTP_USERNAME
JRELEASER_HTTP_${name}_USERNAME
JRELEASER_HTTP_USERNAME

password

jreleaser.upload.http.${name}.password
jreleaser.upload.http.password
jreleaser.http.${name}.password
jreleaser.http.password

JRELEASER_UPLOAD_HTTP_${name}_PASSWORD
JRELEASER_UPLOAD_HTTP_PASSWORD
JRELEASER_HTTP_${name}_PASSWORD
JRELEASER_HTTP_PASSWORD

Substitute ${name} for the value of the named instance.

Space (' '), underscore (_), and dash (-) will be replaced by dot (.) to separate tokens in the System property. Space (' '), dash (-), and dot (.) will be replaced by underscore (_) to separate tokens in the environment variable, such that:

${name} System Property Environment Variable

foobar

foobar

FOOBAR

fooBar

foobar

FOOBAR

foo bar

foo.bar

FOO_BAR

foo-bar

foo.bar

FOO_BAR

foo_bar

foo.bar

FOO_BAR

foo.bar

foo.bar

FOO_BAR

UploadUrl

The uploadUrl is the URL to upload the artifacts to.

An example configuration may look like uploadUrl: 'https://artifacts.company.com:8081/upload/{{projectName}}/{{tagName}}/{{artifactFile}}'.

And will result in a final deployment like https://artifacts.company.com:8081/upload/app/v1.0.0/app-1.0.0.zip.

DownloadUrl

The downloadUrl is the URL used to download artifacts from.

An example configuration may look like downloadUrl: 'https://artifacts.company.com:8081/upload/{{projectName}}/{{tagName}}/{{artifactFile}}'.

And will result in a final URL like https://artifacts.company.com:8081/upload/app/v1.0.0/app-1.0.0.zip.

Skip Upload

Distributions and Artifacts may define extra properties that may stop them from being uploaded. These properties must conform to the following rules:

  • skipUpload: skipped from all uploaders.

  • skipUpload<type>: skipped from the typed uploader.

  • skipUpload<type><name>: skipped from the typed and named uploader.

Where <type> resolves to Http and <name> resolves to the capitalized name of the http instance, such that:

  • if the name is foo the resulting property key is skipUploadHttpFoo.

  • if the name is fooBar the resulting property key is skipUploadHttpFooBar.

  • if the name is foo-bar the resulting property key is skipUploadHttpFooBar.