Child pages
  • Groovy plug
Skip to end of metadata
Go to start of metadata

General Info




Apache 2.0


free, open-source

Plugin Description

Implements several TeamCity extension points with Groovy code. The code can be changed at run-time (by modifying a file under <TeamCity data directory> on the disk). Provides several useful properties out-of-the-box.

Please note that plugin is meant for demonstration purposes and if you plan to use it on a large active TeamCity installation, you should consider implementing the functionality you need in a plain Java plugin.


  • Prior to TeamCity 10.1, put libraries found under the application_libs directory (available via the download link below) into the WEB-INF/lib directory of TeamCity web application. (This step must also be repeated if you reinstall/upgrade TeamCity)
    (warning) Since 10.1, this step is not required as groovy libraries are packed into the plugin zip.
  • put the plugin into <TeamCity data directory>/plugins
  • restart the server
  • if you edited the scripts earlier and need to use the newly introduced features, rename <TeamCity data directory>/config/_groovyPlug_/*.dist files dropping the .dist suffix.
  • It is recommended to ensure you have at least 150m set to -XX:MaxPermSize JVM option.


Edit the files in <TeamCity data directory>/config/_groovyPlug_. The changes take effect immediately, no server restart is needed.


This section describes the current state of the plugin. Earlier versions might have differences in property sets and naming. Also, no guarantees are made as to future plugin versions: the property set can change and properties may be renamed.

The plugin implements the following extension points:

Extension point

Implementation description


empty demo extension


Provides build properties: / env.BUILD_START_DATE / env.BUILD_START_TIME<simplified VCS root name> / env.BUILD_VCS_LASTINCLUDED_REVISION_<simplified VCS root name in uppercase> - the revision of the last change of the noted VCS root included into the build. If there is only single VCS root, .<simplified VCS root name> may be omitted.<simplified VCS root name> / env.BUILD_VCS_LASTINCLUDED_TIMESTAMP_<simplified VCS root name in uppercase> - the timestamp of the last change of the noted VCS root included into the build. If there is only single VCS root, .<simplified VCS root name> may be omitted.
build.triggeredBy / build.triggeredBy.username

Starting from 8.1, these properties should be replaced with /

runParam.<name of run parameter> - Beware: this exposes build configuration settings to a user that can run the build (via custom build)


To use the feature, add system.locks.readLock.<lockName> or system.locks.writeLock.<lockName> property to the build configuration.
The build with writeLock will only start when there are no builds running with read or write locks of the same name.
The build with readLock will only start when there are no builds running with write lock of the same name.


Empty implementation. Allows to perform actions on various build and server events.


since TeamCity 5.1 Sample implementation. Allows to add objects to model used within notification templates.

TeamCity Versions Compatibility

The trunk plugin version should work with the latest TeamCity public build (EAP or release).
There are also branch builds compatible with TeamCity 4.5.x, 5.0.x, 5.1.x, 6.0.x and 6.5.x. See the #Download section.

Since version 8.0, the shared resources functionality is implemented as a separate plugin
Since version 8.1, the information about the user who triggered the build is reported by the TeamCity core. Issue: TW-4502, parameters description

See Download section for CI builds.
Sources (sources corresponding to the latest TeamCity EAP can be found under trunk.


From CI server:
trunk compatible with TeamCity 2017.1+
branch compatible with TeamCity 7.x - 10.0
branch compatible with TeamCity 6.5.x
branch compatible with TeamCity 6.0.x
branch compatible with TeamCity 5.0.x
branch compatible with TeamCity 4.x

Related Materials


  • No labels