Kotlin DSL jars incomplete for local development

When generating my project from the Teamcity UI it generates a settings.kts like this:

import jetbrains.buildServer.configs.kotlin.v2018_1.*
import jetbrains.buildServer.configs.kotlin.v2018_1.vcs.GitVcsRoot
import jetbrains.buildServer.configs.kotlin.v2018_1.buildSteps.script
import jetbrains.buildServer.configs.kotlin.v2018_1.triggers.vcs

This compiles on the teamcity server but does NOT compile locally. It complains with:

Error:(2, 53) Kotlin: Unresolved reference: vcs
Error:(3, 53) Kotlin: Unresolved reference: buildSteps
Error:(4, 53) Kotlin: Unresolved reference: triggers

I checked the jar provided at "http://download.jetbrains.com/teamcity-repository/org/jetbrains/teamcity/configs-dsl-kotlin/2018.1/" and it doesn't include a vcs, buildSteps, or a triggers package.

 

0
4 comments

Hi Charles,

 

There is a full set of libraries, not just that one, which provide the different classes. The project should include a pom.xml that should pull all the different libraries and the missing packages should be there.

0
Avatar
Permanently deleted user

Here's my pom - I've checked all of these and can't find them. Can you tell me where these should be found so I can check those dependencies?

<?xml version="1.0"?>
<project>
<modelVersion>4.0.0</modelVersion>
<name>Config DSL Script</name>
<groupId>GithubSync</groupId>
<artifactId>GithubSync_dsl</artifactId>
<version>1.0-SNAPSHOT</version>

<parent>
<groupId>org.jetbrains.teamcity</groupId>
<artifactId>configs-dsl-kotlin-parent</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>

<repositories>
<repository>
<id>jetbrains-all</id>
<url>http://download.jetbrains.com/teamcity-repository</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>teamcity-server</id>
<url>https://private_server/app/dsl-plugins-repository</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>

<pluginRepositories>
<pluginRepository>
<id>JetBrains</id>
<url>http://download.jetbrains.com/teamcity-repository</url>
</pluginRepository>
</pluginRepositories>

<build>
<sourceDirectory>.</sourceDirectory>
<plugins>
<plugin>
<artifactId>kotlin-maven-plugin</artifactId>
<groupId>org.jetbrains.kotlin</groupId>
<version>${kotlin.version}</version>

<configuration/>
<executions>
<execution>
<id>compile</id>
<phase>process-sources</phase>
<goals>
<goal>compile</goal>
</goals>
</execution>
<execution>
<id>test-compile</id>
<phase>process-test-sources</phase>
<goals>
<goal>test-compile</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.jetbrains.teamcity</groupId>
<artifactId>teamcity-configs-maven-plugin</artifactId>
<version>${teamcity.dsl.version}</version>
<configuration>
<format>kotlin</format>
<dstDir>target/generated-configs</dstDir>
</configuration>
</plugin>
</plugins>
</build>

<dependencies>
<dependency>
<groupId>org.jetbrains.teamcity</groupId>
<artifactId>configs-dsl-kotlin</artifactId>
<version>2018.2</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.jetbrains.teamcity</groupId>
<artifactId>configs-dsl-kotlin-plugins</artifactId>
<version>1.0-SNAPSHOT</version>
<type>pom</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib-jdk8</artifactId>
<version>${kotlin.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-script-runtime</artifactId>
<version>${kotlin.version}</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
0

Hi Charles,

 

Sorry for the delay. They aren't in the jetbrains repositories, they are generated by the server itself. They will be generated on runtime by the server, because plugins can provide their own support for DSL including extra functionality that centralizing them on a repository wouldn't be able to.

0
Avatar
Permanently deleted user

I think I figured it out but we don't have it fixed yet so I might check in. Apparently when we installed a plugin someone had downloaded it twice. That resulted in the filename having a "(1)" in it. This is the error thrown before the compiler errors:

The POM for org.jetbrains.teamcity:configs-dsl-kotlin-plugins:pom:1.0-20190209.165043-1 is invalid, transitive dependencies (if any) will not be available: 1 problem was encountered while building the effective model for org.jetbrains.teamcity:configs-dsl-kotlin-plugins:1.0-SNAPSHOT
[ERROR] 'dependencies.dependency.artifactId' for org.jetbrains.teamcity:configs-dsl-kotlin-teamcity-kubernetes-plugin (1):jar with value 'configs-dsl-kotlin-teamcity-kubernetes-plugin (1)' does not match a valid id pattern. @

Here is the relevant part of the pom that's invalid:

<dependency>
<groupId>org.jetbrains.teamcity</groupId>
<artifactId>configs-dsl-kotlin-teamcity-kubernetes-plugin (1)</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>

We're going to re-install the plugin over the next few days (Big releases atm - need to wait for a safe time) and then I'll check back in

0

Please sign in to leave a comment.