My inşa dosyası şöyle görünür:nasıl ext olsun * eklentileri içine değişkenler build.gradle.kts engellemek
val nexusBaseUri: String by extra
val gradle_version: String by extra
val kotlin_version: String by extra
buildscript {
val nexusBaseUri by extra { "https://mynexusserver/nexus" }
val gradle_version by extra { "4.1" }
val kotlin_version by extra { "1.1.4-3" }
val springBoot_version by extra { "2.0.0.M3" }
repositories {
maven { url = uri("$nexusBaseUri/repository/public") }
jcenter()
maven { url = uri("http://repo.spring.io/snapshot") }
maven { url = uri("http://repo.spring.io/milestone") }
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:$springBoot_version")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version")
classpath("org.jetbrains.kotlin:kotlin-allopen:$kotlin_version")
}
}
plugins {
application
// vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
// the following line causes a problem
// vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
kotlin("jvm", kotlin_version)
}
apply {
plugin("kotlin-spring")
plugin("org.springframework.boot")
plugin("io.spring.dependency-management")
}
application {
mainClassName = "eqip.fid.FdmlInterpreterDeveloperAppKt"
}
repositories {
maven { url = uri("$nexusBaseUri/content/groups/public") }
jcenter()
maven { url = uri("http://repo.spring.io/snapshot") }
maven { url = uri("http://repo.spring.io/milestone") }
}
dependencies {
compile(kotlin("stdlib"))
compile("org.springframework.boot:spring-boot-starter-web")
}
tasks {
"wrapper"(Wrapper::class) {
gradleVersion = gradle_version
}
}
Ben IntelliJ IDEA olsun hata
'val kotlin_version edilir : String, bu bağlamda örtülü alıcı tarafından çağrılmaz. Gerekirse açık bir bunu düzeltmek nasıl
kullanılsın mı?
Blog'un dışında erişilebilir bu sürümüplugins
içinde bir sürümünü tanımlamak ve sonra yapabilirsiniz
ile değiştirmek zorunda olacak. Bu soru, bir yanıt ile stackoverflow üzerinde zaten sorulmuştu, sadece başka birinin karşısında koşması durumunda cevabı buraya koymak istedim. https://stackoverflow.com/a/37749402/559536 – Alex