Artifactory provides tight integration with TeamCity CI Server through the TeamCity Artifactory Plug-in. Beyond managing efficient deployment of your artifacts to Artifactory, the plug-in lets you capture information about artifacts deployed, dependencies resolved, environment data associated with the TeamCity build runs and more, which effectively provides full traceability for your builds.
From version 2.1.0 the TeamCity Artifactory Plug-in provides powerful features for release management and promotion. For details please refer to TeamCity Artifactory Plugin - Release Management.
Before you begin
Please refer to the general information about Artifactory's Build Integration before using the TeamCity Artifactory Plugin.
Source Code Available!
The TeamCity Artifactory Plugin is an open source project on GitHub that you can freely browse and fork.
Build Runner Support
The TeamCity Artifactory plugin supports most build runner types, including: Maven2, Maven 3, Ivy/Ant (with Ivy modules support), Gradle , NAnt, MSBuild, FxCop , and Ipr.
Installing the Plugin
Plugins are deployed to TeamCity by placing the packaged plugin into the
$<TeamCity Data Directory>/plugins directory and restarting TeamCity. You can also accomplish this via the TeamCity UI via Administration | Plugins List | Upload Plugin Zip and choosing the zip-file from your file-system. You will need to restart TeamCity (tomcat) for the plugin to take effect.
Download the latest version of the plugin from the JetBrains Marketplace.
Remove older versions
If you have an older version of the plug-in, be sure to remove it before upgrading to a newer one
To use the TeamCity Artifactory plugin you first need to configure your Artifactory servers in TeamCity's server configuration. You can then set up a project build runner to deploy artifacts and Build Info to a repository on one of the Artifactory servers configured.
Configuring System-wide Artifactory Servers
To make Artifactory servers globally available to project runner configurations, they must be defined in Administration | Integrations | Artifactory.
Select Create new Artifactory server configuration and fill in the URL of the Artifactory server.
Deployer credentials can be set at the global level for all builds, but they can also be overridden and set at a project build level.
Specifying a username and password for the resolver repository is optional. It is only used when querying Artifactory's REST API for a list of configured repositories and then only if the target instance does not allow anonymous access.
Running a Build with the Artifactory Plugin
The Artifactory Plugin adds the Artifactory configuration to the built-in Maven, Gradle, and Ant and build steps.
In addition, the dedicated Artifactory Docker build step allows pulling and pushing docker images from and to Artifactory, while collecting and publishing build-info to Artifactory.
Generic Build Integration allows downloading and uploading generic files from and to Artifactory, while collecting build Info and publishing it to Artifactory. The Generic Build Integration configuration is added by the Artifactory to the following build steps:
Visual Studio (sln)
Visual Studio 2003
SBT, Scala build tool
The configuration added to these build steps allows defining the artifacts to upload and download by either using "File Specs" or "Legacy Patterns".
File Spec are specified in JSON format. You can read the File Spec schema here.
Legacy Patterns (deprecated)
Legacy patterns are deprecated since version 1.8.0 and will be removed in future releases.
Custom published artifacts
Allows you to specify which artifact files produced by the build should be published to Artifactory. At the end of the build the plugin locates artifacts in the build's checkout directory according to the specified artifact patterns, and publishes them to Artifactory to one or more locations, optionally applying mapping for the target path of each deployed artifact. The pattern and mapping syntax for Published Artifacts is similar to the one used by TeamCity for Build Artifacts.
Custom build dependencies
Allows you to specify dependency patterns for published artifacts that should be downloaded from Artifactory before the build is run. You can have detailed control over which artifacts are resolved and downloaded by using query-based resolution, adding to your artifact paths a query with the properties that the artifact should have before it can be downloaded. For further information read here about Resolution by Properties.
As of version 2.1.4, the above configuration is not backward compatible and you may need to re-save the builds configuration for them to run properly.
Triggering Build Retention in Artifactory
You can trigger build retention when publishing build-info to Artifactory.
Scanning Builds with JFrog Xray
The TeamCity Artifactory Plugin is integrated with JFrog Xray through JFrog Artifactory, allowing you to have build artifacts scanned for vulnerabilities and other issues. If issues or vulnerabilities are found, you may choose to fail a build job. The scan result details are always printed into the build log. This integration requires JFrog Artifactory v4.16 and above and JFrog Xray v1.6 and above.
For Xray to scan builds, you need to configure a Watch with the right filters that specify which artifacts and vulnerabilities should trigger an alert, and set a Fail Build Job Action for that Watch. You can read more about CI/CD integration with Xray here.
Attaching Searchable Parameters to Build-Info and to Published Artifacts
In the Build Configuration Settings you can select Parameters to define system properties or environment variables that should be attached to artifacts and their corresponding build info.
To define a parameter click on the Add new parameter button.
Fill in the corresponding fields.
Parameters relevant for builds run through Artifactory are:
buildInfo.property.*- All properties starting with this prefix are added to the root properties of the build-info
artifactory.deploy.*- All properties starting with this prefix are attached to any deployed produced artifacts
You can specify all the properties in a single file, and then define another property pointing to it.
To point the plugin to a properties file, define a property called
buildInfoConfig.propertiesFile and set its value to the absolute path of the properties file.
It is also possible to point the plugin to a properties file containing the aforementioned properties.
The properties file should be located on the machine running the build agent, not on the server!
Browsing to the Published Build-info in Artifactory
If you configured your build step to publish build-info to Artifactory, you can link directly to the build information in Artifactory from a build run view:
Triggering Builds in Reaction to Changes in Artifactory
The plugin allows you to set a new type of trigger that periodically polls a path in Artifactory, a folder, or an individual file. Whenever a change is detected in the polled element, the TeamCity build is triggered. For example, the build could be triggered when new artifacts have been deployed to the specified path in Artifactory.
Artifactory Pro required
Triggering builds is only available with Artifactory Pro
To configure a new build trigger, under Administration, select $PROJECT_NAME | $BUILD_NAME. Then, select Triggers.
Click the Add new trigger button to select an Artifactory Build Trigger
Select the Artifactory Server URL and the Target repository.
Complete the username and password fields of a valid deployer for the selected repository.
The specified user must have deploy permissions on the repository
Then, in Items to watch, specify the paths in the selected repository in which a change should automatically trigger a build.
Be as specific as possible in Items to watch
In order to establish if there has been a change, Artifactory must traverse all the folders and their sub-folders specified in Items to watch. If the specified folders have a lot of content and sub-folders, this is a resource-intensive operation that can take a long time.
Therefore, we recommend being as specific as possible when specifying folders inItems to watch.
If the Artifactory server is accessed via a proxy, you need to configure the proxy by setting the following properties in the
$TEAMCITY_USER_HOME/.BuildServer/config/internal.properties file. If the file does not exist, you'll need to create it.
org.jfrog.artifactory.proxy.host org.jfrog.artifactory.proxy.port org.jfrog.artifactory.proxy.username org.jfrog.artifactory.proxy.password
Since version 2.5.0, you can also define a proxy for specific build agents. You do that by adding the TeamCity agent name to the end of the above property names.
For example, if you wish to configure a proxy for the "my-agent" agent, the proxy properties configuration should look as follows:
org.jfrog.artifactory.proxy.host.my-agent org.jfrog.artifactory.proxy.port.my-agent org.jfrog.artifactory.proxy.username.my-agent org.jfrog.artifactory.proxy.password.my-agent
In case your build agent name contains a white-space, you should replace the white-space in the property name with \u0020.
For example, here's how you define the proxy host for the "Default Agent":
The TeamCity Artifactory plugin is available under the Apache v2 License.
Click to see change log details...
2.10.0 (December 16, 2022)
2.9.5 (November 28, 2022)
Bug fix - Wrong build-info URL in Artifactory 7 - #124
2.9.4 (August 14, 2022)
Bug fix - Artifactory deploy proprieties are not saved on deployed artifacts - #116
2.9.3 (June 09, 2022)
Bug fix - Trigger configuration does not list repositories - #105
2.9.1 (6 Jun 2021)
Bug fix - Artifactory response parsing can fail due to missing JSON properties - https://github.com/jfrog/build-info/pull/502
2.9.0 (1 Dec 2020)
New Artifactory Docker build step
2.8.0 (3 Jan 2019)
2.7.1 (20 August 2018)
2.6.0 (9 April 2018)
2.5.0 (28 Sep 2017)
2.4.0 (29 Jun 2017)
2.3.1 (23 Jan 2017)
2.3.0 (13 Nov 2016)
Upload and download File Specs support to generic jobs (TCAP-284)
2.2.1 (19 May 2016)
Bug fix (TCAP-214)
2.2.0 (21 March 2016)
2.1.13 (4 May 2015)
2.1.12 (12 Mar 2015)
Adding support for free text repository configuration (TCAP-217)
2.1.11 (7 Dec 2014)
2.1.10 (8 May 2014)
2.1.9 (17 Apr 2014)
2.1.8 (15 Jan 2014)
2.1.7 (18 Dec 2013)
Add support for blackduck integration - TCAP-185
2.1.6 (03 Sep 2013)
2.1.5 (07 Jul 2013)
2.1.4 (21 Aug 2012)
Compatible with TeamCity7.1.
2.1.3 (30 May 2012)
Compatible with TeamCity7.
Support 'Perforce' in release management.
Support multiple deploy targets for the same source pattern in generic deploy.
Support for custom build dependencies resolution per build.
2.1.2 (12 Dec 2011)
Compatible with Gradle 1.0-milestone-6.
2.1.1 (09 Aug 2011)
Support for Gradle milestone-4
Better support for releasing nested Maven projects
Fixed minor Maven deployments discrepancies
2.1.0 (14 Jul 2011)
Release management capabilities
2.0.1 (9 Jan 2011)
Auto Snapshot/Release target repository selection
Add ivy/artifact deploy patterns
Improved Gradle support
2.0.0 (5 Dec 2010)
Support for Gradle builds
Support for maven3 builds
Default deployer add resolver credentials
Support for muti steps builds
1.1.3 (21 Nov 2010)
Include/exclude pattern for artifacts deployment
1.1.2 (7 Nov 2010)
Control for including published artifacts when running license checks
Limiting license checks to scopes
Control for turning off license discovery when running license checks