question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Kotlin DSL does not refer to bom version properly

See original GitHub issue
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
  id("org.springframework.boot") version "2.1.5.RELEASE"
  id("io.spring.dependency-management") version "0.6.0.RELEASE"
  kotlin("jvm") version "1.2.71"
  kotlin("plugin.spring") version "1.2.71"
}

group = "com.dont39"
version = "0.0.1-SNAPSHOT"
java.sourceCompatibility = JavaVersion.VERSION_1_8

repositories {
  mavenCentral()
}

extra["springCloudVersion"] = "Greenwich.SR1"

dependencies {
  implementation("org.springframework.boot:spring-boot-starter-actuator")
  implementation("org.springframework.boot:spring-boot-starter-web")
  implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
  implementation("org.jetbrains.kotlin:kotlin-reflect")
  implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
  implementation("org.springframework.cloud:spring-cloud-config-server")
  implementation("org.springframework.cloud:spring-cloud-starter-config")
  implementation("org.springframework.cloud:spring-cloud-starter-consul-discovery")
  testImplementation("org.springframework.boot:spring-boot-starter-test")
}

dependencyManagement {
  imports {
    mavenBom("org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}") 
// Should use extra["springCloudVersion"]
  }
}

tasks.withType<KotlinCompile> {
  kotlinOptions {
    freeCompilerArgs = listOf("-Xjsr305=strict")
    jvmTarget = "1.8"
  }
}

In dependencyManagement, should use ${extra[“springCloudVersion”]} instead of ${springCloudVersion}.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
wilkinsonacommented, May 17, 2019

by default it’s generating code that is not compiling.

Thanks, but we’re already aware of that. That’s why this issue exists and is still open. As @snicoll has already indicated, a fix will be provided ASAP.

0reactions
snicollcommented, May 17, 2019

@Dontcampy thank you very much for reporting the problem with a sample, that was very helpful.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Version control plugins. BOM for plugins? - Stack Overflow
When i click on class PluginVersion in module1 i see only bite code, and IDEA don't wont decompile it, and i can't see...
Read more >
Kotlin-bom in multiplatform projects?
This fails with an “Unresolved reference: implementation” error. From what I gather, this is because the Kotlin plugin isn't actually applied ...
Read more >
Using Kotlin - Quarkus
Using a different Kotlin version in a Quarkus application is typically not recommended. But in order to do so, you must import the...
Read more >
Building Kotlin Libraries Sample - Gradle User Manual
When prompted, select the 3: library project type and 4: Kotlin as implementation language. Next you can choose the DSL for writing buildscripts...
Read more >
Using the SDK with Gradle - AWS SDK for Java 1.x
Gradle automatically resolves the correct version of your SDK dependencies by using the information from the BOM. The following is an example of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found