TeamCity On-Premises 2023.11 Help

Build Artifact

Build artifacts are files produced by a build. Typically, these include distribution packages, WAR files, reports, log files, and so on. When creating a build configuration, you specify the paths to the artifacts of your build on the Configuring General Settings page.

Artifacts Storage

TeamCity contains an integrated lightweight builds artifact repository. The artifacts are stored either on the server-accessible file system or on an external storage.

Upon the build finish, TeamCity searches for artifacts in the build checkout directory according to the specified artifact path or path patterns. The matching files are then uploaded ("published") to the TeamCity server, where they become available for downloading through the web UI or can be used in other builds using artifact dependencies. You can choose when to publish artifacts: for all completed builds, only for successful builds, or for all builds, even the interrupted ones.

To download artifacts of a build, go to the Artifacts tab of the build results page or use the artifacts icon artifactIcon.png available on the project or build configuration Overview page and on the TeamCity pages that list the builds.

In case of the built-in storage, TeamCity keeps artifacts on the disk in a directory structure that can be accessed directly (for example, by configuring the operating system to share the directory over the network). The storage format is described in TeamCity Data Directory. The artifacts are stored on the server "as is" without additional compression. By default, the artifacts are stored under the <TeamCity Data Directory\>/system/artifacts directory which can be changed.
You can configure an external artifacts storage to replace the built-in one.

Build artifacts can also be uploaded to the server while the build is still running. To instruct TeamCity to upload the artifacts, the build script should be modified to send service messages.

You can automate artifacts downloading via REST API.

Hidden Artifacts

In addition to user-defined artifacts, TeamCity also generates and publishes some hidden artifacts for internal purposes.
For example, for Maven builds, TeamCity creates the maven-build-info.xml file that contains Maven-specific data collected during the build. The content of the file is then used to visualize the Maven data on the Maven Build Info tab in the build results.

TeamCity stores hidden artifacts in the .teamcity directory in the artifacts' root.

Artifact dependencies do not consider hidden artifacts, unless they explicitly specify .teamcity in their pattern.

Hidden artifacts are not deleted by the artifacts clean-up unless .teamcity is explicitly specified in the clean-up scope.

Examples of hidden artifacts:

  • maven-build-info.xml.gz — Maven build data. Used to display data on the Maven Build Info tab.

  • the properties directory — holds properties calculated for the build on the agent. There are properties actual before the build and after the build. These are displayed on the Properties tab of build results.

  • .NETCoverage — raw .NET coverage data (for example, used to open dotCover data in VS add-in).

  • coverage_idea — raw IntelliJ IDEA coverage data (for example, used to open coverage in IDEA).

Retrieve Hidden Artifacts

Hidden artifacts are not displayed on the Artifacts tab by default. If there are any of them in the current build, you can reveal them by clicking Show hidden artifacts.

To browse or download artifacts individually, use the artifacts' tree. To download the whole .teamcity directory, click Download all (.zip) in the right part of the screen.

Hide Artifacts

To hide an artifact, you need to publish it under the .teamcity directory.

Artifacts Cache on Agent

All artifacts published by a build are stored in the agent's artifacts cache in <Build Agent home>\system\.artifacts_cache, which helps speed up artifact dependencies in some cases.
However, depending on the size of artifacts, clean-up, and other settings, artifacts caching may cause low disk space on the agent. You can configure storing published artifacts in the agent cache.

Build Artifacts Video Guide

Last modified: 25 January 2024