找不到Kotlin脚本Gradle的kotlin-gradle-plugin

构建失败,类路径错误:

thufir@dur:~/NetBeansProjects/kotlinShadowJar$ thufir@dur:~/NetBeansProjects/kotlinShadowJar$ gradle clean FAILURE: Build failed with an exception. * What went wrong: A problem occurred configuring root project 'kotlinShadowJar'. > Could not resolve all files for configuration ':classpath'. > Could not find org.jetbrains.kotlin:kotlin-gradle-plugin:. Searched in the following locations: file:/home/thufir/.gradle/caches/4.3.1/embedded-kotlin-repo-1.1.51-1/repo/org/jetbrains/kotlin/kotlin-gradle-plugin//kotlin-gradle-plugin-.pom file:/home/thufir/.gradle/caches/4.3.1/embedded-kotlin-repo-1.1.51-1/repo/org/jetbrains/kotlin/kotlin-gradle-plugin//kotlin-gradle-plugin-.jar https://repo1.maven.org/maven2/org/jetbrains/kotlin/kotlin-gradle-plugin//kotlin-gradle-plugin-.pom https://repo1.maven.org/maven2/org/jetbrains/kotlin/kotlin-gradle-plugin//kotlin-gradle-plugin-.jar https://repo.gradle.org/gradle/repo/org/jetbrains/kotlin/kotlin-gradle-plugin//kotlin-gradle-plugin-.pom https://repo.gradle.org/gradle/repo/org/jetbrains/kotlin/kotlin-gradle-plugin//kotlin-gradle-plugin-.jar Required by: project : * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. * Get more help at https://help.gradle.org BUILD FAILED in 1s thufir@dur:~/NetBeansProjects/kotlinShadowJar$ 

构建文件:

 thufir@dur:~/NetBeansProjects/kotlinShadowJar$ thufir@dur:~/NetBeansProjects/kotlinShadowJar$ cat build.gradle.kts import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar buildscript { repositories { mavenCentral() gradleScriptKotlin() } dependencies { classpath(kotlinModule("gradle-plugin")) classpath("com.github.jengelman.gradle.plugins:shadow:1.2.3") } } apply { plugin("kotlin") plugin("com.github.johnrengelman.shadow") } repositories { mavenCentral() } val shadowJar: ShadowJar by tasks shadowJar.apply { manifest.attributes.apply { put("Implementation-Title", "Gradle Jar File Example") put("Implementation-Version" version) put("Main-Class", "com.mkyong.DateUtils") } baseName = project.name + "-all" }thufir@dur:~/NetBeansProjects/kotlinShadowJar$ 

构建文件是工作构建的直接副本 。 上下文正在开始使用Kotlin脚本Gradle 。 据我所知,剧本应该是好的 。

请注意,我没有使用intelli-J,这是严格来自Kotlin脚本Gradle的CLI。

也许这是相当简单的 ,像“插件”与“插件”…