Gradle can';t解决';科特林';插件。我是否缺少正确的maven存储库?
Gradle can';t解决';科特林';插件。我是否缺少正确的maven存储库?,gradle,kotlin,build.gradle,gradle-plugin,Gradle,Kotlin,Build.gradle,Gradle Plugin,gradletasks失败,告诉我找不到插件“kotlin”。我的build.gradle文件以以下内容开头: buildscript { ext.kotlin_version = '1.3.11' repositories { mavenLocal() mavenCentral() jcenter() maven { url "https://dl.bintray.com/kotlin/kotlin-dev/" } maven { url "ht
gradletasks
失败,告诉我找不到插件“kotlin”。我的build.gradle
文件以以下内容开头:
buildscript {
ext.kotlin_version = '1.3.11'
repositories {
mavenLocal()
mavenCentral()
jcenter()
maven { url "https://dl.bintray.com/kotlin/kotlin-dev/" }
maven { url "http://central.maven.org/maven2/" }
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
plugins {
id 'kotlin'
id 'application'
}
警告maven,我显然只是想冗余地添加我能找到的所有厨房水槽。我一个也没试过,但也评论了一些。我错过了哪一个?
从日志中:
12:55:04.419 [DEBUG] [org.gradle.launcher.daemon.server.exec.ReturnResult] Daemon is dispatching the build result: Failure[value=org.gradle.initialization.Repor
tedException: org.gradle.internal.exceptions.LocationAwareException: Build file '/home/_/workspace/_/build.gradle' line: 18
Plugin [id: 'kotlin'] was not found in any of the following sources:
- Gradle Core Plugins (not a core plugin, please see https://docs.gradle.org/5.0/userguide/standard_plugins.html for available core plugins)
- Plugin Repositories (plugin dependency must include a version number for this source)]
我也尝试过1.3.10版,因为它符合gradle版本信息中列出的内容:
------------------------------------------------------------
Gradle 5.0
------------------------------------------------------------
Build time: 2018-11-26 11:48:43 UTC
Revision: 7fc6e5abf2fc5fe0824aec8a0f5462664dbcd987
Kotlin DSL: 1.0.4
Kotlin: 1.3.10
Groovy: 2.5.4
Ant: Apache Ant(TM) version 1.9.13 compiled on July 10 2018
JVM: 1.8.0_181 (Oracle Corporation 25.181-b13)
OS: Linux 4.19.6-200.fc28.x86_64 amd64
Kotlin不是一个核心插件,因此您必须包含该版本。使用插件
配置时,名称也不同:
plugins {
id "org.jetbrains.kotlin.jvm" version "1.3.11"
}
如果使用apply
功能,您仍然可以使用简单的名称:
apply plugin: "kotlin"
您可以在上找到此信息。没有ID为“kotlin”的插件。文档如下:
id
行失败:“参数列表必须正好是1个文本非空字符串”,您不能在那里使用变量。版本必须是常量和文字字符串。不允许有其他声明;它们的存在将导致编译错误。