Sftp

Downloads artifacts, files, and signatures from a SFTP server.

Configuration

Legend:

  • required

  • optional

  • may use environment variable

  • accepts Name Templates

  • YAML

  • TOML

  • JSON

  • Maven

  • Gradle

# 
download:
  # 
  sftp:
    # 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 `sftp`, i.e, `sftpFoo`.
        foo: bar

      # Host where the SFTP service is enabled.
      #  
      host: downloads.acme.com

      # Port number of SFTP service.
      # Defaults to `22`.
      #  
      port: 22

      # The username required for authorization.
      #  
      username: __USE_ENVIRONMENT_VARIABLE__

      # Password for login into the SFTP service.
      #  
      password: __USE_ENVIRONMENT_VARIABLE__

      # The public SSH key.
      #  
      publicKey: __USE_ENVIRONMENT_VARIABLE__

      # The private SSH key.
      #  
      privateKey: __USE_ENVIRONMENT_VARIABLE__

      # The passphrase required to read private keys.
      #  
      passphrase: __USE_ENVIRONMENT_VARIABLE__

      # The remote server's SSH fingerprint.
      #  
      fingerprint: __USE_ENVIRONMENT_VARIABLE__

      # A list of assets to be downloaded.
      # 
      assets:
          # Full download path to asset.
          #  
        - input: '/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.sftp.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 `sftp`, i.e, `sftpFoo`.

  # Host where the SFTP service is enabled.
  #  
  host = "downloads.acme.com"

  # Port number of SFTP service.
  # Defaults to `port`.
  #  
  port = 22

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

  # Password for login into the SFTP service.
  #  
  password = "__USE_ENVIRONMENT_VARIABLE__"

  # The public SSH key.
  #  
  publicKey = "__USE_ENVIRONMENT_VARIABLE__"

  # The private SSH key.
  #  
  privateKey = "__USE_ENVIRONMENT_VARIABLE__"

  # The passphrase required to read private keys.
  #  
  passphrase = "__USE_ENVIRONMENT_VARIABLE__"

  # The remote server's SSH fingerprint.
  #  
  fingerprint = "__USE_ENVIRONMENT_VARIABLE__"

  # A list of assets to be downloaded.
  # 
  [[dowload.sftp.app.assets]]
    # Full download path to asset.
    #  
    input = "/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": {
    // 
    "sftp": {
      // 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 `sftp`, i.e, `sftpFoo`.
          "foo": "bar"
        },

        // Host where the SFTP service is enabled.
        // If left unspecified, the `JRELEASER_SFTP_${name}_HOST`
        // environment variable must be defined.
        //  
        "host": "downloads.acme.com",

        // Port number of SFTP service.
        // If left unspecified, the `JRELEASER_SFTP_${name}_PORT`
        // environment variable must be defined.
        // Defaults to `22`.
        //  
        "port": 22,

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

        // Password for login into the SFTP service.
        // If left unspecified, the `JRELEASER_SFTP_${name}_PASSWORD`
        // environment variable must be defined.
        //  
        "password": "__USE_ENVIRONMENT_VARIABLE__",

        // The public SSH key.
        //  
        "publicKey": "__USE_ENVIRONMENT_VARIABLE__",

        // The private SSH key.
        //  
        "privateKey": "__USE_ENVIRONMENT_VARIABLE__",

        // The passphrase required to read private keys.
        //  
        "passphrase": "__USE_ENVIRONMENT_VARIABLE__",

        // The remote server's SSH fingerprint.
        //  
        "fingerprint": "__USE_ENVIRONMENT_VARIABLE__",

        // A list of assets to be downloaded.
        // 
        "assets": [
          {
            // Full download path to asset.
            //  
            "input": "/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>
    <!--
      
    -->
    <sftp>
      <!--
        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 `sftp`, i.e, `sftpFoo`.
          -->
          <foo>bar</foo>
        </extraProperties>

        <!--
          Host where the SFTP service is enabled.
           
        -->
        <host>downloads.acme.com</host>

        <!--
          Port number of SFTP service.
          Defaults to `22`.
           
        -->
        <port>22</port>

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

        <!--
          Password for login into the SFTP service.
           
        -->
        <password>__USE_ENVIRONMENT_VARIABLE__</password>

        <!--
          The public SSH key.
           
        -->
        <publicKey>__USE_ENVIRONMENT_VARIABLE__</publicKey>

        <!--
          The private SSH key.
           
        -->
        <privateKey>__USE_ENVIRONMENT_VARIABLE__</privateKey>

        <!--
          The passphrase required to read private keys.
           
        -->
        <passphrase>__USE_ENVIRONMENT_VARIABLE__</passphrase>

        <!--
          The remote server's SSH fingerprint.
           
        -->
        <fingerprint>__USE_ENVIRONMENT_VARIABLE__</fingerprint>

        <!--
          A list of assets to be downloaded.
          
        -->
        <assets>
          <asset>
            <!--
              Full download path to asset.
               
            -->
            <input>/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>
    </sftp>
  </download>
</jreleaser>
jreleaser {
  // 
  download {
    // 
    sftp {
      // 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 `sftp`, i.e, `sftpFoo`.
        // 
        extraProperties.put('foo', 'bar')

        // Host where the SFTP service is enabled.
        //  
        host = 'downloads.acme.com'

        // Port number of SFTP service.
        // Defaults to `22`.
        //  
        port = 22

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

        // Password for login into the SFTP service.
        //  
        password = '__USE_ENVIRONMENT_VARIABLE__'

        // The public SSH key.
        //  
        publicKey = '__USE_ENVIRONMENT_VARIABLE__'

        // The private SSH key.
        //  
        privateKey = '__USE_ENVIRONMENT_VARIABLE__'

        // The passphrase required to read private keys.
        //  
        passphrase = '__USE_ENVIRONMENT_VARIABLE__'

        // The remote server's SSH fingerprint.
        //  
        fingerprint = '__USE_ENVIRONMENT_VARIABLE__'

        // A list of assets to be downloaded.
        // 
        asset {
          // Full download path to asset.
          //  
          input = '/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
          }
       }
      }
    }
  }
}

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.download.sftp.${name}.active
jreleaser.download.sftp.active

JRELEASER_DOWNLOAD_SFTP_${name}_ACTIVE
JRELEASER_DOWNLOAD_SFTP_ACTIVE

host

jreleaser.download.sftp.${name}.host
jreleaser.download.ssh.${name}.host
jreleaser.download.sftp.host
jreleaser.download.ssh.host
jreleaser.sftp.${name}.host
jreleaser.ssh.${name}.host
jreleaser.sftp.host
jreleaser.ssh.host

JRELEASER_DOWNLOAD_SFTP_${name}_HOST
JRELEASER_DOWNLOAD_SSH_${name}_HOST
JRELEASER_DOWNLOAD_SFTP_HOST
JRELEASER_DOWNLOAD_SSH_HOST
JRELEASER_SFTP_${name}_HOST
JRELEASER_SSH_${name}_HOST
JRELEASER_SFTP_HOST
JRELEASER_SSH_HOST

port

jreleaser.download.sftp.${name}.port
jreleaser.download.ssh.${name}.port
jreleaser.download.sftp.port
jreleaser.download.ssh.port
jreleaser.sftp.${name}.port
jreleaser.ssh.${name}.port
jreleaser.sftp.port
jreleaser.ssh.port

JRELEASER_DOWNLOAD_SFTP_${name}_PORT
JRELEASER_DOWNLOAD_SSH_${name}_PORT
JRELEASER_DOWNLOAD_SFTP_PORT
JRELEASER_DOWNLOAD_SSH_PORT
JRELEASER_SFTP_${name}_PORT
JRELEASER_SSH_${name}_PORT
JRELEASER_SFTP_PORT
JRELEASER_SSH_PORT

username

jreleaser.download.sftp.${name}.username
jreleaser.download.ssh.${name}.username
jreleaser.download.sftp.username
jreleaser.download.ssh.username
jreleaser.sftp.${name}.username
jreleaser.ssh.${name}.username
jreleaser.sftp.username
jreleaser.ssh.username

JRELEASER_DOWNLOAD_SFTP_${name}_USERNAME
JRELEASER_DOWNLOAD_SSH_${name}_USERNAME
JRELEASER_DOWNLOAD_SFTP_USERNAME
JRELEASER_DOWNLOAD_SSH_USERNAME
JRELEASER_SFTP_${name}_USERNAME
JRELEASER_SSH_${name}_USERNAME
JRELEASER_SFTP_USERNAME
JRELEASER_SSH_USERNAME

password

jreleaser.download.sftp.${name}.password
jreleaser.download.ssh.${name}.password
jreleaser.download.sftp.password
jreleaser.download.ssh.password
jreleaser.sftp.${name}.password
jreleaser.ssh.${name}.password
jreleaser.sftp.password
jreleaser.ssh.password

JRELEASER_DOWNLOAD_SFTP_${name}_PASSWORD
JRELEASER_DOWNLOAD_SSH_${name}_PASSWORD
JRELEASER_DOWNLOAD_SFTP_PASSWORD
JRELEASER_DOWNLOAD_SSH_PASSWORD
JRELEASER_SFTP_${name}_PASSWORD
JRELEASER_SSH_${name}_PASSWORD
JRELEASER_SFTP_PASSWORD
JRELEASER_SSH_PASSWORD

publicKey

jreleaser.download.sftp.${name}.public.key
jreleaser.download.ssh.${name}.public.key
jreleaser.download.sftp.public.key
jreleaser.download.ssh.public.key
jreleaser.sftp.${name}.public.key
jreleaser.ssh.${name}.public.key
jreleaser.sftp.public.key
jreleaser.ssh.public.key

JRELEASER_DOWNLOAD_SFTP_${name}_PUBLIC_KEY
JRELEASER_DOWNLOAD_SSH_${name}_PUBLIC_KEY
JRELEASER_DOWNLOAD_SFTP_PUBLIC_KEY
JRELEASER_DOWNLOAD_SSH_PUBLIC_KEY
JRELEASER_SFTP_${name}_PUBLIC_KEY
JRELEASER_SSH_${name}_PUBLIC_KEY
JRELEASER_SFTP_PUBLIC_KEY
JRELEASER_SSH_PUBLIC_KEY

privateKey

jreleaser.download.sftp.${name}.private.key
jreleaser.download.ssh.${name}.private.key
jreleaser.download.sftp.private.key
jreleaser.download.ssh.private.key
jreleaser.sftp.${name}.private.key
jreleaser.ssh.${name}.private.key
jreleaser.sftp.private.key
jreleaser.ssh.private.key

JRELEASER_DOWNLOAD_SFTP_${name}_PRIVATE_KEY
JRELEASER_DOWNLOAD_SSH_${name}_PRIVATE_KEY
JRELEASER_DOWNLOAD_SFTP_PRIVATE_KEY
JRELEASER_DOWNLOAD_SSH_PRIVATE_KEY
JRELEASER_SFTP_${name}_PRIVATE_KEY
JRELEASER_SSH_${name}_PRIVATE_KEY
JRELEASER_SFTP_PRIVATE_KEY
JRELEASER_SSH_PRIVATE_KEY

passphrase

jreleaser.download.sftp.${name}.passphrase
jreleaser.download.ssh.${name}.passphrase
jreleaser.download.sftp.passphrase
jreleaser.download.ssh.passphrase
jreleaser.sftp.${name}.passphrase
jreleaser.ssh.${name}.passphrase
jreleaser.sftp.passphrase
jreleaser.ssh.passphrase

JRELEASER_DOWNLOAD_SFTP_${name}_PASSPHRASE
JRELEASER_DOWNLOAD_SSH_${name}_PASSPHRASE
JRELEASER_DOWNLOAD_SFTP_PASSPHRASE
JRELEASER_DOWNLOAD_SSH_PASSPHRASE
JRELEASER_SFTP_${name}_PASSPHRASE
JRELEASER_SSH_${name}_PASSPHRASE
JRELEASER_SFTP_PASSPHRASE
JRELEASER_SSH_PASSPHRASE

fingerprint

jreleaser.download.sftp.${name}.fingerprint
jreleaser.download.ssh.${name}.fingerprint
jreleaser.download.sftp.fingerprint
jreleaser.download.ssh.fingerprint
jreleaser.sftp.${name}.fingerprint
jreleaser.ssh.${name}.fingerprint
jreleaser.sftp.fingerprint
jreleaser.ssh.fingerprint

JRELEASER_DOWNLOAD_SFTP_${name}_FINGERPRINT
JRELEASER_DOWNLOAD_SSH_${name}_FINGERPRINT
JRELEASER_DOWNLOAD_SFTP_FINGERPRINT
JRELEASER_DOWNLOAD_SSH_FINGERPRINT
JRELEASER_SFTP_${name}_FINGERPRINT
JRELEASER_SSH_${name}_FINGERPRINT
JRELEASER_SFTP_FINGERPRINT
JRELEASER_SSH_FINGERPRINT

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