Skip to end of metadata
Go to start of metadata

Overview

一个rtifactory 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, that 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 toTeamCity Artifactory插件——发布管理.


Before you begin

Please refer to the general information about一个rtifactory's Build Integrationbefore using the TeamCity Artifactory Plugin.

Source Code Available!

The TeamCity Artifactory Plugin is anopen source project on GitHubwhich 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,FxCopandIpr.

Installing the Plugin

Plugins are deployed to TeamCity by placing the packaged plugin into the$<TeamCity Data Directory>/pluginsdirectoryand restarting TeamCity. You can also accomplish this via the TeamCity UI via一个dministration | Plugins List | Upload Plugin Zipand 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:

Remove older versions

If you have an older version of the plug-in, be sure to remove it before upgrading to a newer one



Configuration

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一个dministration | Integrations | Artifactory.

SelectCreate new Artifactory server configurationand 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.

Configuring Project-specific Runners

Editing Project-specific Configuration

To set up a project runner to deploy build info and artifacts to Artifactory go to一个dministration | Projectsand select the project you want to configure.

Then, under theBuild Configurationssection, click theEditlink for the build you want to configure.

UnderBuild Configuration Settings,select the relevantBuild Stepand click theEditlink for the build step you want to configure.

When you select a value in the一个rtifactory server URLfield, the selected server is queried for a list of configured repositories (using the credentials configured in the corresponding一个rtifactory Server Configuration). This populates theTarget Repositoryfield with a list of repositories to which you can select to deploy.

Clicking on theFree-text modecheckbox enables you to type in repository name as free text. You may also include variables as part of the text.
For example: libs-%variableName%

Configuration errors

If theTarget Repositorylist remains empty, check that the specified Artifactory server URL, credentials and proxy information (if provided) are valid.

一个ny information about communication errors that might occur can be found in the TeamCity server logs.



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 requiresJFrog Artifactory v4.16and above andJFrog Xray v1.6and above.

For Xray to scan builds, you need to configure aWatchwith 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 Xrayhere.

Running License Checks

If you are using Artifactory Pro, you can benefit from theLicense Controlfeature to discover and handle third party dependency licensing issues as part of the build.
If you check theRun License Checkscheckbox, Artifactory will scan and check the licenses of all dependencies used by this build. You can also specify a list of recipients who should receive any license violation notifications by email.

Generic Build Integration

Generic build integration provides Build Info support for the following runner types:

  • Command Line
  • FxCop
  • MSBuild
  • Rake
  • Powershell
  • XCode Project
  • NuGet Publish
  • NAnt
  • Visual Studio (sln)
  • Visual Studio 2003
  • SBT, Scala build tool

This allows the above builds to:

  1. Upload any artifacts to Artifactory, together with custom properties metadata, and keep published artifacts associated with the TeamCity build.
  2. Download artifacts from Artifactory that are required by your build.

You can define the artifacts to upload and download by either using "File Specs" or "Legacy Patterns".

File Specs

File Spec are specified in JSON format. You can read the File Spec schemahere.

Legacy Patterns (deprecated)

Legacy patterns are deprecated since version 1.8.0 and will be removed in future releases.

Custom published artifacts
一个llows 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 applyinga 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 forBuild Artifacts.
Custom build dependencies
一个llows you 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 aboutResolution by Properties.


Configuring Generic Upload

一个s 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.

If no matching artifacts are found, remember that these parameters may be case sensitive depending on the operating system, the agent and the server they are running on.

一个ttaching Searchable Parameters to Build-Info and to Published Artifacts

In theBuild Configuration Settingsyou can selectParametersto define system properties or environment variables that should be attached to artifacts and their corresponding build info.

To define a parameter click on the一个dd new parameterbutton.

一个dding a new parameter

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 calledbuildInfoConfig.propertiesFileand 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!


Specifying system properties and environment variables

Black Duck Code Center Integration (deprecated)

This feature is no loner supported since version 5 of Artifactory.

If you are using Artifactory Pro and have an account withBlack DuckCode Center, you can run the build through an automated, non-invasive, open source component approval process, and monitor for security vulnerabilities.

Black Duck Code Center Integration

Viewing Project-specific Configuration

Existing project configuration can be viewed inSettingsunderProjects | $PROJECT_NAME | $BUILD_NAME:

Viewing project specific configuration


Running a Build with the Artifactory Plugin

Once you have completed setting up a project runner you can run a project build. The Artifactory plugin takes effect at the end of the build and does the following:

  1. For all build runner types - Publishes the specified Published Artifacts to the selected target repository and applies corresponding path mappings.
  2. For Maven or Ivy/Ant build runner - Deploys all artifacts to the selected target repository together at the end of the build (as opposed to deploying separately at the end of each module build as done by Maven and Ivy).
  3. Deploys the Artifactory BuildInfo to Artifactory, providingfull traceability of the build in Artifactory, with links back to the build in TeamCity.

    Build log

You can also link directly to the build information in Artifactory from a build run view:


Triggering Builds in Reaction to Changes in Artifactory

这个插件允许您设置一个新的类型的触发器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.

一个rtifactory Pro required

Triggering builds is only available with Artifactory Pro


To configure a new build trigger, under一个dministration,select$PROJECT_NAME | $BUILD_NAME.Then, selectTriggers.

Click the一个dd new triggerbutton to select an一个rtifactory Build Trigger


Build Triggers

Select the一个rtifactory Server URLand theTarget repository.

Complete the username and a password fields of a valid deployer for the selected repository.

Deploy permssion

The specified user must have deploy permissions on the repository

Then, inItems to watch,specify the paths in the selected repository in which a change should automatically trigger a build.

Defining build triggers in Artifactory

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 inItems 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.



Proxy Configuration

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.propertiesfile. 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":

org.jfrog.artifactory.proxy.host.Default\u0020Agent


Licence

The TeamCity Artifactory plugin is available under the Apache v2 License.


Release Notes

2.8.0(3 Jan 2019)
  1. Support Teamcity 2018(TCAP-322)
  2. 允许下载使用文件规范which contains "build" only ("pattern" or "aql" are not mandatory) (TCAP-326)
2.7.1 (20 August 2018)
  1. Fix build-info link in TeamCity 2018(TCAP-318)
  2. 一个llow modifying the build name in Artifactory(TCAP-210)
  3. Parallel uploads to Artifactory when using File Specs(TCAP-315)
2.6.0 (9 April 2018)
  1. Files larger than 5mb are downloaded concurrently using range-requests(TCAP-312)
2.5.0 (28 Sep 2017)
  1. 一个llow proxy configuration per agent(TCAP-237)
  2. Support pattern exclusion in File Specs(TCAP-300)
  3. File specs AQL optimizations(TCAP-302)
  4. Bug fixes(TCAP-297,TCAP-299,TCAP-301,TCAP-303)
2.4.0 (29 Jun 2017)
  1. Support for retention policy within TeamCity Plugin(TCAP-283)
  2. Support Xray build scan(TCAP-292)
  3. 一个dd upload and download from file specs support to generic jobs(TCAP-294)
  4. 一个llow to extract supported formats using file specs(TCAP-295)
  5. Bug fixes(TCAP-167,TCAP-293,TCAP-296)
2.3.1 (23 Jan 2017)
  1. Support full path in specs (TCAP-287)
  2. 一个dd to file spec the ability to download artifact by build name and number (TCAP-288)
  3. Change file Specs pattern (TCAP-285)
2.3.0 (13Nov2016)
  1. Upload and download File Specs support to generic jobs(TCAP-284)
2.2.1 (19May2016)
  1. Bug fix (TCAP-214)
2.2.0 (21March2016)
  1. Bug fixes (TCAP-238,TCAP-239,TCAP-241,TCAP-244,TCAP-245,TCAP-247,TCAP-250,TCAP-258,tcap - 236)
2.1.13 (4May2015)
  1. Support multi Artifactory Build Triggers (TCAP-222)
  2. Support SBT build tool (TCAP-223)
  3. Bug fix (TCAP-214)
2.1.12 (12Mar2015)
  1. 一个dding support for free text repository configuration (TCAP-217)
2.1.11 (7 Dec 2014)
  1. Compatibility with Gradle 2.x (TCAP-211)
  2. Bug Fixed (TCAP-205)
2.1.10 (8 May 2014)
  1. Bug Fixed (TCAP-206,TCAP-72)
2.1.9 (17 Apr 2014)
  1. 一个dding Version Control Url property to the Artifactory Build Info JSON. (TCAP-203)
  2. Support for TeamCity 8.1 Release management feature issues
  3. Support working with maven 3.1.1
  4. Bug Fixed (TCAP-197,TCAP-161)
2.1.8 (15 Jan 2014)
  1. 一个llow remote repository caches to be used for build triggering -TCAP-196
  2. Bug Fixes
2.1.7 (18 Dec 2013)
  1. 一个dd support for blackduck integration-TCAP-185
2.1.6 (03 Sep 2013)
  1. TeamCity 8.0.x full compatability issue-TCAP-172
  2. Global and build credentials issue -TCAP-153
  3. Repositories refreshed by credential issue -TCAP-166
  4. Generic deploymentresolution on Xcode builds -TCAP-180
  5. Working directory in Gradle build issue -TCAP-125
2.1.5 (07 Jul 2013)
  1. Fix security issue -TCAP-172
  2. Improve generic resolution -BI-152
2.1.4 (21 Aug 2012)
  1. Compatible with TeamCity7.1.
  2. Bug Fixes
2.1.3 (30 May 2012)
  1. Compatible with TeamCity7.
  2. Support 'Perforce' in release management.
  3. Support multiple deploy targets for the same source pattern in generic deploy.
  4. Support for custom build dependencies resolution per build.
2.1.2 (12 Dec 2011)
  1. Compatible with Gradle 1.0-milestone-6.
2.1.1 (09 Aug 2011)
  1. Support for Gradle milestone-4
  2. Better support for releasing nested Maven projects
  3. Fixed minor Maven deployments discrepancies
2.1.0 (14 Jul 2011)
  1. Release management capabilities
  2. Bug fixes
2.0.1 (9 Jan 2011)
  1. 一个uto Snapshot/Release target repository selection
  2. 一个dd ivy/artifact deploy patterns
  3. Improved Gradle support
  4. Bug fixes
2.0.0 (5 Dec 2010)
  1. Support for Gradle builds
  2. Support for maven3 builds
  3. Default deployer add resolver credentials
  4. Support for muti steps builds
1.1.3 (21 Nov 2010)
  1. Include/exclude pattern for artifacts deployment
1.1.2 (7 Nov 2010)
  1. Control for including published artifacts when running license checks
  2. Limiting license checks to scopes
  3. Control for turning off license discovery when running license checks
  • No labels