IntelliJ 在 Gradle Kotlin-DSL 中错误地抱怨它找不到“java.lang.String”

lat*_*ell 6 java intellij-idea gradle kotlin

在以下 build.gradle.kts (Kotlin DSL) 脚本中,IntelliJ 将“mainClassName”标记为红色并抱怨:“无法访问类 'java.lang.String'。检查您的模块类路径是否缺少或冲突的依赖项。”

使用./gradlew clean assemble命令行上,一切正常。

谁能给我一个提示如何解决这个问题?

IntelliJ 是最新版本 2019.1-社区。

------------------------------------------------------------
Gradle 5.3.1
------------------------------------------------------------

Build time:   2019-03-28 09:09:23 UTC
Revision:     f2fae6ba563cfb772c8bc35d31e43c59a5b620c3

Kotlin:       1.3.21
Groovy:       2.5.4
Ant:          Apache Ant(TM) version 1.9.13 compiled on July 10 2018
JVM:          11.0.2 (Oracle Corporation 11.0.2+9)
OS:           Linux 4.9.0-8-amd64 amd64
Run Code Online (Sandbox Code Playgroud)
plugins {
    java
    application
}

group = "de.lathspell"
version = "1.0-SNAPSHOT"

repositories {
    mavenCentral()
}

dependencies {
    testCompile("junit", "junit", "4.12")
}

configure<JavaPluginConvention> {
    sourceCompatibility = JavaVersion.VERSION_1_8
}

configure<ApplicationPluginConvention> {
    mainClassName = "de.lathspell.App"
}
Run Code Online (Sandbox Code Playgroud)

可在https://github.com/lathspell/gradle_test/tree/master/java-gradle-kts下载,提交 5e5da7b。