现在我用这种方式:
plugins {
val kotlinVersion: String by project
val springBootPluginVersion: String by project
val springDependencyManagementPluginVersion: String by project
id("org.jetbrains.kotlin.plugin.allopen") version kotlinVersion
id("org.jetbrains.kotlin.jvm") version kotlinVersion
id("org.springframework.boot") version springBootPluginVersion
id("io.spring.dependency-management") version springDependencyManagementPluginVersion
}
Run Code Online (Sandbox Code Playgroud)
这个变种编译和工作,但我不知道这是正确的,为什么IntelliJ IDEA在放置版本定义的行上显示错误:
'val Build_gradle.project: Project' can't be called in this context by implicit receiver. Use the explicit one if necessary
Run Code Online (Sandbox Code Playgroud)