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.

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.
      # Valid 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

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

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

      # 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.
      # Valid 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.
      # Valid 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 files.
      # Defaults to `true`.
      # 
      files: true

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

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

      # Additional properties used when evaluating templates.
      # 
      extraProperties:
        # Key will be capitalized and prefixed with `http`, i.e, `httpFoo`.
        foo: bar
# Uploaders require a name.
# 
[upload.http.app]

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

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

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

  # 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.
  # Valid 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.
  # Valid 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 files.
  # Defaults to `true`.
  # 
  files = true

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

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

  # Additional properties used when evaluating templates.
  # 
  extraProperties.foo = "bar"
  # Key will be capitalized and prefixed with `http`, i.e, `httpFoo`.
{
  // 
  "upload": {
    // 
    "http": {
      // Uploaders require a name.
      // 
      "app": {

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

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

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

        // 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.
        // Valid 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.
        // Valid 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 files.
        // Defaults to `true`.
        // 
        "files": true,

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

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

        // Additional properties used when evaluating templates.
        // 
        "extraProperties": {
          // Key will be capitalized and prefixed with `http`, i.e, `httpFoo`.
          "foo": "bar"
        }
      }
    }
  }
}
<jreleaser>
  <!--
    
  -->
  <upload>
    <!--
      
    -->
    <http>
      <!--
        Uploaders require a name.
        
      -->
      <app>
        <!--
          Enables or disables the distribution.
          Valid values are [`NEVER`, `ALWAYS`, `RELEASE`, `SNAPSHOT`].
          Defaults to `ALWAYS`.
          
        -->
        <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>

        <!--
          URL of the HTTP/HTTPS server + path + artifact.
           
        -->
        <uploadUrl>https://my.server.com/{{projectName}}/{{tagName}}/{{artifactFileName}}</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}}/{{artifactFileName}}</downloadUrl>

        <!--
          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.
          Valid 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.
          Valid 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>

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

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

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

        <!--
          Additional properties used when evaluating templates.
          
        -->
        <extraProperties>
          <!--
            Key will be capitalized and prefixed with `http`, i.e, `httpFoo`.
          -->
          <foo>bar</foo>
        </extraProperties>
      </app>
    </http>
  </upload>
</jreleaser>
jreleaser {
  // 
  upload {
    // 
    http {
      // Uploaders require a name.
      // 
      app {

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

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

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

        // 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.
        // Valid 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.
        // Valid 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}}')

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

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

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

        // Additional properties used when evaluating templates.
        // Key will be capitalized and prefixed with `http`, i.e, `httpFoo`.
        // 
        extraProperties.put('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}}/{{artifactFileName}}'.

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}}/{{artifactFileName}}'.

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

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.

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.