现在我用这种方式:
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
}
这个变体可以编译并工作,但我不知道这种方式是否正确以及为什么 IntelliJ IDEA 在放置版本定义的行上显示错误:
'val Build_gradle.project: Project' can't be called in this context by implicit receiver. Use the explicit one if necessary