Updating Ant to version 1.10

As documented in https://confluence.jetbrains.com/display/TCD18/Supported+Platforms+and+Environments TeamCity 2018.1 comes bundled with Ant 1.9.11, but it supports Ant 1.6-1.10, which is great, because I need to use Ant 1.10 in my project.

What is the correct way to update a "bundled plugin", such as Ant? I've observed that it exists in several places:

  • In the server machine, it's in \TeamCity\webapps\ROOT\WEB-INF\plugins\ant-tool\agent\ant.zip
  • In the agents, it's in \AGENT\plugins\ant\

Should I update ant.zip in the server machine, and then restart everything (?) and hope that agents update themselves?

Or should I manually update each agent's plugins\ant\ directory? Should I then also update ant.zip in server, so that it doesn't accidentally downgrade Ant at some later point?

0
4 comments
Avatar
Permanently deleted user

You shouldn't update the existing plugin, either the agent or server side zip files. What you can do is repackage the Ant 1.10 distribution adding a TeamCity plugin descriptor. The name of the plugin is then available as a configuration parameter for use in build configurations. The documentation for the plugin descriptor is here https://confluence.jetbrains.com/display/TCD18/Plugins+Packaging#PluginsPackaging-Tools

I've repackaged a few tools in the past you can see example Gradle scripts here https://github.com/rodm/teamcity-tools

0
Avatar
Permanently deleted user

Thanks for the answer!

Following that, repackaging Ant 1.10 was trivial, just modify Apache Ant 1.10.5 distribution by copying structure and teamcity-plugin.xmls (modified a bit) from TeamCity's bundled Ant distribution. Zip it, "Upload plugin zip", and it gets into "External plugins" list beautifully.

But. I don't yet understand what I should do with that vs. the existing bundled Ant distribution.

The name of the plugin is then available as a configuration parameter for use in build configurations didn't magically happen.

"Apache Ant runner support" plugin's - which AFAIK represents Ant in the "Runner type" dropdown list in build step configuration - agent side depends on "ant" tool, i.e. the actual Ant distribution. Now I have two ants - the one bundled by JetBrains, and the one bundled by me. What defines which of them will be used by the runner?

Disabling the JetBrains-bundled ant seems to solve this - then runner is using ant that I bundled. So far so good! Just wondering, is this the "right" way to solve this, or should there be some versioning magic intended for this kind of scenarios.

0
Avatar
Permanently deleted user

The name of the agent side plugin archive, for example ant1_10.zip, is used to create an Agent parameter called teamcity.tool.ant1_10. This parameter can then be used to specify the Ant home in a build configuration using the Ant Runner,  so in the 'Ant home path' you would put %teamcity.tool.ant1_10% to use your repackaged Ant.

0
Avatar
Permanently deleted user

Ah, ok! Thanks.

Anyway, if one would like to update Ant globally,

  • Using ant.zip as name for the agent side plugin archive in the new bundle
  • Disabling JetBrains-bundled ant

seems to work fine.

0

Please sign in to leave a comment.