Create an Artifactory Server Instance - Declarative Pipeline Syntax

JFrog Integrations Documentation

Content Type

There are two ways to tell the pipeline script which Artifactory server to use. You can either define the server details as part of the pipeline script, or define the server details in Manage | Configure System.

If you choose to define the Artifactory server in the pipeline, add the following to the script:

rtServer (
    id: 'Artifactory-1',
    url: 'http://my-artifactory-domain/artifactory',
        // If you're using username and password:
    username: 'user',
    password: 'password',
        // If you're using Credentials ID:
        credentialsId: 'ccrreeddeennttiiaall',
        // If Jenkins is configured to use an http proxy, you can bypass the proxy when using this Artifactory server:
        bypassProxy: true,
        // Configure the connection timeout (in seconds).
        // The default value (if not configured) is 300 seconds: 
        timeout: 300

You can also use a Jenkins Credential ID instead of the username and password:

The id property (Artifactory-1 in the above examples) is a unique identifier for this server, allowing us to reference this server later in the script. If you prefer to define the server in Manage | Configure System, you don't need to add the rtServerit definition as shown above. You can use the reference the server using its configured Server ID.