| You are viewing documentation of TeamCity 3.x, which is not the most recent released version of TeamCity. Please refer to the listing to choose another version. |
|
Documentation Index
|
Configuring Artifact DependenciesA build configuration can be made dependent on the artifacts of builds of some other build configurations. That means that before the build, all artifacts, the build configuration is dependent on will be downloaded and placed in their configured target locations and then can be used by the build. There are two ways to define artifact dependencies:
Configuring Dependencies Using the Web UITo add dependencies to a build configuration:
Configuring Dependencies in Ant build.xmlThis solution is more complicated but allows greater flexibility. For example, configuring dependencies in this way will allow you to start a personal build and verify that your build is still compatible with dependencies. To configure dependencies in Ant build.xml: 1. Download Ivy.
2. Add Ivy to the classpath of your build. 4. Replace YOUR_TEAMCITY_HOST_NAME with the host name of your TeamCity server. 5. Place ivyconf.xml in the directory where your build.xml will be running. 6. In the same directory create ivy.xml file in which define which artifacts should be downloaded and where to put them, for example: Where
7. Modify your build.xml file and add tasks for downloading artifacts, for example (applicable for Ant 1.6 and later): Please note that among ivy commons-httpclient, commons-logging and commons-codec should be in classpath of Ivy tasks. Since 2.1 artifacts repository is protected by basic authentication. For accessing artifacts you should provide credentials to the <ivy:configure/> task. For example: where TEAMCITY_HOST is hostname or IP address of your TeamCity server (without port and servlet context). The properties teamcity.auth.userId/teamcity.auth.password store automatically generated build-unique values whose only intended use is artifacts downloading within the build script. The values are valid only during the time the build is running. Using the properties is preferable to using reall user credentials since it allows the server to track artifacts downloaded by your build. If the artifacts were downloaded by the build configuration artifact dependencies or using the supplied properties, the specific artifacts used by the build will be displayed on the build results page. In addition, the builds which were used to get the artifacts from will not be cleaned up by the clean-up process much like the pinned builds. See also: |