因此,我在项目中将kotlin插件设置为最新的稳定版本1.3.72
,但是我有一个依赖关系,其中该插件被定义为id 'org.jetbrains.kotlin.jvm' version 1.+
,因此它会提取1.4-M1
无法解决,并且出现以下错误:
Could not find org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.4-M1.
Possible solution:
- Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html
这是我在build.gradle文件中定义其版本的方式:
plugins {
id 'org.jetbrains.kotlin.jvm' version '1.3.72'
id 'org.jetbrains.dokka' version '0.10.1'
}
...
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
...
}
因为org.jetbrains.kotlin:kotlin-stdlib-jdk8没有1.4-M1版本,所以gradle无法解决。有什么方法可以强制降级该版本?
答案 0 :(得分:0)
我终于找到了答案,我严格定义了org.jetbrains.kotlin:kotlin-stdlib-jdk8
的版本,并强制使用所定义的版本进行ktor依赖:
ext {
ktor_version='1.3.0'
}
dependencies {
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8") {
version {
strictly "1.3.72"
}
because "1.4-M1 is not released"
}
implementation("io.ktor:ktor-server-core:$ktor_version") { force=true }
}