Kotlin Help

Kotlin and continuous integration with TeamCity

On this page, you'll learn how to configure TeamCity to build Kotlin applications. For TeamCity installation and basic setup, refer to the TeamCity documentation.

Kotlin integrates directly with standard build tools like Gradle and Maven, so configuring a Kotlin build in TeamCity requires the same workflow as any project. If you compile your project using the IntelliJ IDEA build system instead, TeamCity provides a dedicated runner.

Gradle and Maven

When you build with Gradle or Maven, the build configuration file (build.gradle.kts or pom.xml) already declares the Kotlin dependencies and compiler plugins. TeamCity does not require any additional Kotlin-specific settings.

For Gradle, add a Gradle build step to your build configuration and specify the Step name and Gradle tasks you want to run.

Gradle Build Step

Similarly, for Maven, add a Maven build step and specify the Step name and Goals you want to execute.

IntelliJ IDEA build system

If you build your project using IntelliJ IDEA project files, the Kotlin version in TeamCity must match the version configured in your IDE project. You can automate downloading and configuring the Kotlin compiler by using a TeamCity recipe. Recipes are the evolution of meta-runners: they serve the same purpose but offer additional benefits like YAML support and easy sharing on JetBrains Marketplace.

  1. Download and import the recipe.

  2. Add the Kotlin compiler fetching step.

    • Add a build step using the imported runner.

    • Specify the Step name and the required Kotlin Version.

      Setup Kotlin Compiler

  1. Add the compilation step. Add an IntelliJ IDEA Project runner step after the compiler-fetching step to compile the project and produce the build artifacts.

    IntelliJ IDEA Project runner

Other CI servers

If you use a CI system other than TeamCity, invoke the standard Gradle or Maven commands directly in your pipeline scripts.

What's next

18 September 2026