Configuration as code - compile kotlin code through command line
I just enabled Versioned Settings and am planning to store my Teamcity configurations as kotlin files.
I am able to compile the generated .pom and .kts files using IntelliJ IDEA just fine. As I usually use Visual Studio Code as IDE I would ideally like to compile the Teamcity configuration through the command line instead of using IDEA. I am new to Java/Kotlin/Maven though and whatever other related technologies that may be necessary, and I haven't been able to find any info regarding this.
What I did try was running "mvn compile" inside the project folder, which downloads a bunch of files and seems to compile something. However it seems to ignore any changes i make to the kts file, so I am pretty sure this is not the right way to do it.
How can I compile kotlin Teamcity configuration code through the command line?
Please sign in to leave a comment.
Hi Dennis,
To test locally your setup, you need to run the "generate" task, rather than compile, as described here: https://www.jetbrains.com/help/teamcity/kotlin-dsl.html#KotlinDSL-Settingsvalidation
You can run it by running "mvn teamcity-configs:generate" on the project folder.