What is the extent of Ivy integration
Our organization has several C++ projects in need of improved dependency management and we use TeamCity Enterprise as our CI server. A requirement for our improvement is that the dependencies be managed in the repository not merely in the TeamCity admin interface so the build dependencies track with the changes in the source code. TCD10 docs tell us that you can specify archive dependencies using an ivy file if you are using Ant to build and that TeamCity acts as an Ivy repository. However, it leaves a number of questions open that googling did not answer:
- If I specify an ivyconf.xml and ivy.xml, will TeamCity reflect it in the web interface (for example, under the dependencies tab)?
- If present, will such a representation update based on changes to the ivy.xml?
- Is this only for builds using Ant?
- Can the Ivy integration handle transitive archive dependencies (i.e. A depends on B and B depends on C, so A pulls in the archives from both B and C)
Finally:
- What is the recommended mechanism to control dependencies at build time. For example, achieving: project 1 version A being dependent on archives generated by a build of project 2 version B but project 1 version C being dependent on archives generated by project 2 version D and these dependencies being stored in the repository of project 1.
Please sign in to leave a comment.
Hi, and sorry for the delay, I'll try to answer your questions, if you feel I missed something, please feel free to follow up.
The configuration described in the article of our documentation shows how to use TeamCity's Ivy repository from within ant builds, even when they are used outside TeamCity. This is useful as you can use the same script between teamcity and development environment, but some of the information is lost in the way. This Ivy repository can also be used from within maven/gradle builds.
With this in mind, the dependencies tab in teamcity displays information about the dependencies configured within TeamCity. As using them through ant doesn't give teamcity that information, TeamCity cannot display specific information about it. If the ant script logs the dependencies, information about them will be available in the build log.
In builds after changes to the dependencies, obviously this information will be updated, the information is produced by the builds themselves. Please do take into account that if you are not explicitly using a specific version, and instead use lastSuccessful, we have an issue https://youtrack.jetbrains.com/issue/TW-51557 where the build system (ant, maven, gradle...) will cache the package and will not update even if you update the package in the repository, so it's recommended to use specific versions until the issue is fixed.
I can't currently confirm whether transitive dependencies are available, but TeamCity's artifacts don't have dependencies on their own, only builds do, so I don't expect they would work. I will confirm this shortly though.
Regarding what we recommend to control dependencies: This depends on how your builds are done and what you are trying to get. If you are already using some sort of artifact server, such as maven, nuget or artifactory, then you probably want to keep reusing it for your builds and your last step should probably include publishing your artifact there. If you aren't using any of them, then you can use the integrated TeamCity's dependency management, Ivy server or NuGet server for this same purpose. The integrated dependency management works for some scenarios, but has the disadvantage that you need a different build script for teamcity (where the dependency system provides the artifacts) and development/test environments, where teamcity can't provide any files and you need to fetch them on your own. In many scenarios this is irrelevant, but we cannot tell from the outside, so you need to check advantages and disadvantages and make a decision based on your own scenario.