Artifactory

Uploads artifacts, files, and signatures to a JFrog Artifactory instance.

Prerequisites:
  • A running Artifactory instance.

  • A generic repository.

  • A user + password / token with grants to upload an artifact.

This feature does not support deploying JARs and POMs to a Maven repository.
You may use this uploader with Sonatype Nexus as well, just configure the right host, credentials, and path matching your settings.

Configuration

Legend:

  • required

  • optional

  • may use environment variable

  • accepts Name Templates

  • YAML

  • TOML

  • JSON

  • Maven

  • Gradle

# 
upload:
  # 
  artifactory:
    # 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 `artifactory`, i.e, `artifactoryFoo`.
        foo: bar

      # URL of the Artifactory host.
      #  
      host: https://host.com/artifactory

      # The username that can write to the repository.
      #  
      username: __USE_ENVIRONMENT_VARIABLE__

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

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

      # List of repositories where artifacts will be uploaded.
      # 
      repositories:

          # Path where the artifact will be uploaded to.
          #  
        - path: 'binaries/{{projectName}}/{{projectVersion}}/{{artifactFile}}'

          # Enables or disables the repository.
          # Supported values are [`NEVER`, `ALWAYS`, `RELEASE`, `SNAPSHOT`].
          # Defaults to the active setting of the containing artifactory.
          # 
          active: ALWAYS

          # Set of supported file types.
          # 
          fileTypes:
            - ZIP
            - TGZ
# Uploaders require a name.
# 
[upload.artifactory.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 `artifactory`, i.e, `artifactoryFoo`.

  # URL of the Artifactory host.
  #  
  host = "https://host.com/artifactory"

  # The username that can write to the repository.
  #  
  username = "__USE_ENVIRONMENT_VARIABLE__"

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

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

  # List of repositories where artifacts will be uploaded.
  # 
  [[upload.artifactory.app.repositories]]

    # Path where the artifact will be uploaded to.
    #  
    path = "binaries/{{projectName}}/{{projectVersion}}/{{artifactFile}}"

   # Enables or disables the uploader.
   # Supported values are [`NEVER`, `ALWAYS`, `RELEASE`, `SNAPSHOT`].
   # Defaults to the active setting of the containing artifactory.
   # 
   active = "ALWAYS"

    # Set of supported file types.
    # 
    fileTypes = ["ZIP", "TGZ"]
{
  // 
  "upload": {
    // 
    "artifactory": {
      // 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 `artifactory`, i.e, `artifactoryFoo`.
          "foo": "bar"
        },

        // URL of the Artifactory host.
        //  
        "host": "https://host.com/artifactory",

        // The username that can write to the repository.
        //  
        "username": "__USE_ENVIRONMENT_VARIABLE__",

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

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

        // List of repositories where artifacts will be uploaded.
        // 
        "repositories": [
          {
            // Path where the artifact will be uploaded to.
            //  
            "path": "binaries/{{projectName}}/{{projectVersion}}/{{artifactFile}}",

            // Enables or disables the uploader.
            // Supported values are [`NEVER`, `ALWAYS`, `RELEASE`, `SNAPSHOT`].
            // Defaults to the active setting of the containing artifactory.
            // 
            "active": "ALWAYS",

            // Set of supported file types.
            // 
            "fileTypes": [
              "ZIP",
              "TGZ"
             ]
          }
        ]
      }
    }
  }
}
<jreleaser>
  <!--
    
  -->
  <upload>
    <!--
      
    -->
    <artifactory>
      <!--
        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 `artifactory`, i.e, `artifactoryFoo`.
          -->
          <foo>bar</foo>
        </extraProperties>

        <!--
          URL of the Artifactory host.
           
        -->
        <host>https://host.com/artifactory</host>

        <!--
          The username that can write to the repository.
           
        -->
        <username>__USE_ENVIRONMENT_VARIABLE__</username>

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

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

        <!--
          List of repositories where artifacts will be uploaded.
          
        -->
        <repositories>
          <repository>

          <!--
            Path where the artifact will be uploaded to.
             
          -->
          <path>binaries/{{projectName}}/{{projectVersion}}/{{artifactFile}}</path>

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

          <!--
            Set of supported file types.
            
          -->
          <fileTypes>ZIP,TGZ</fileTypes>
          </repository>
        </repositories>
      </app>
    </artifactory>
  </upload>
</jreleaser>
jreleaser {
  // 
  upload {
    // 
    artifactory {
      // 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 `artifactory`, i.e, `artifactoryFoo`.
        // 
        extraProperties.put('foo', 'bar')

        // URL of the Artifactory host.
        //  
        host = 'https://host.com/artifactory'

        // The username that can write to the repository.
        //  
        username = '__USE_ENVIRONMENT_VARIABLE__'

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

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

        // List of repositories where artifacts will be uploaded.
        // 
        repository {
          // Path where the artifact will be uploaded to.
          //  
          path = 'binaries/{{projectName}}/{{projectVersion}}/{{artifactFile}}'

          // Enables or disables the uploader.
          // Supported values are [`NEVER`, `ALWAYS`, `RELEASE`, `SNAPSHOT`].
          // Defaults to the active setting of the containing artifactory.
          // 
          active = 'ALWAYS'

          // Set of supported file types.
          // 
          fileType = 'ZIP'
          fileType = 'TGZ'
      }
    }
  }
}

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.artifactory.${name}.active
jreleaser.upload.artifactory.active

JRELEASER_UPLOAD_ARTIFACTORY_${name}_ACTIVE
JRELEASER_UPLOAD_ARTIFACTORY_ACTIVE

host

jreleaser.upload.artifactory.${name}.host
jreleaser.upload.artifactory.host
jreleaser.artifactory.${name}.host
jreleaser.artifactory.host

JRELEASER_UPLOAD_ARTIFACTORY_${name}_HOST
JRELEASER_UPLOAD_ARTIFACTORY_HOST
JRELEASER_ARTIFACTORY_${name}_HOST
JRELEASER_ARTIFACTORY_HOST

username

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

JRELEASER_UPLOAD_ARTIFACTORY_${name}_USERNAME
JRELEASER_UPLOAD_ARTIFACTORY_USERNAME
JRELEASER_ARTIFACTORY_${name}_USERNAME
JRELEASER_ARTIFACTORY_USERNAME

password

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

JRELEASER_UPLOAD_ARTIFACTORY_${name}_PASSWORD
JRELEASER_UPLOAD_ARTIFACTORY_PASSWORD
JRELEASER_ARTIFACTORY_${name}_PASSWORD
JRELEASER_ARTIFACTORY_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

File Types

Supported files types are:

  • DEB

  • DMG

  • EXE

  • JAR

  • MSI

  • NUGET

  • PKG

  • RPM

  • TAR

  • TAR_BZ2

  • TAR_GZ

  • TAR_XZ

  • TAR_ZST

  • TBZ2

  • TGZ

  • TXZ

  • ZIP

If a repository does not define any file types then all file types are accepted.

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 Artifactory and <name> resolves to the capitalized name of the artifactory instance, such that:

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

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

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

Example

  • YAML

  • TOML

  • JSON

  • Maven

  • Gradle

upload:
  artifactory:
    duke:
      active: ALWAYS
      host: 'https://host.com/artifactory'
      repository:
        - path: 'binaries/{{projectName}}/{{projectVersion}}/{{artifactFile}}'
[upload.artifactory.duke]
  active = "ALWAYS"
  host = "https://host.com/artifactory"
  [[upload.artifactory.duke.repositories]]
    path = "binaries/{{projectName}}/{{projectVersion}}/{{artifactFile}}"
{
  "jreleaser": {
    "upload": {
      "artifactory": {
        "duke": {
          "active": "ALWAYS",
          "host": "https://host.com/artifactory",
          "repositories": [
            {
              "path": "binaries/{{projectName}}/{{projectVersion}}/{{artifactFile}}"
            }
          ]
        }
      }
    }
  }
}
<jreleaser>
  <upload>
    <artifactory>
      <duke>
        <active>ALWAYS</active>
        <host>https://host.com/artifactory</host>
        <repositories>
          <repository>
            <path>binaries/{{projectName}}/{{projectVersion}}/{{artifactFile}}</path>
          </repository>
        </repositories>
      </duke>
    </artifactory>
  </upload>
</jreleaser>
jreleaser {
  upload {
    artifactory {
      duke {
        active = 'ALWAYS'
        host = 'https://host.com/artifactory'
        repository {
          path = "binaries/{{projectName}}/{{projectVersion}}/{{artifactFile}}"
        }
      }
    }
  }
}

The following environment variables must be defined:

  • JRELEASER_ARTIFACTORY_DUKE_USERNAME

  • JRELEASER_ARTIFACTORY_DUKE_PASSWORD