简体   繁体   English

如何在 gradle 中强制降级插件版本?

[英]How to force downgrade plugin version in in gradle?

So, I have kotlin plugin in my project set to latest stable release 1.3.72 but i have a dependency in which the plugin is defined as id 'org.jetbrains.kotlin.jvm' version 1.+ so it fetches 1.4-M1 which is actually not resolvable and I'm getting the following error:所以,我的项目中的 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

This is how i defined version of it in my build.gradle file:这就是我在 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"
    ...
}

Since the org.jetbrains.kotlin:kotlin-stdlib-jdk8 doesn't have 1.4-M1 release gradle could not resolve it.由于 org.jetbrains.kotlin:kotlin-stdlib-jdk8 没有 1.4-M1 版本 gradle 无法解决它。 Is there any way to force downgrade the version of this?有没有办法强制降级这个版本?

I finally found the answer myself, I strictly defined version of org.jetbrains.kotlin:kotlin-stdlib-jdk8 and forced the ktor-dependency for using the defined version:我自己终于找到了答案,我严格定义了org.jetbrains.kotlin:kotlin-stdlib-jdk8版本,并强制 ktor-dependency 使用定义的版本:

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 }
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Kotlin版本如何降级 - How to downgrade Kotlin version 如何降级 kotlin 版本 - how to downgrade the kotlin version 如何强制 Jacoco 在 Gradle 中使用特定版本 - How to force Jacoco to use a specific version in Gradle 为什么 Gradle 强制使用 Kotlin 版本,以及如何修复它? - Why does Gradle force a Kotlin version, and how to fix it? 如何从用 Kotlin/Java 编写的 gradle 插件设置 gradle 插件版本? - How to set gradle plugin version from gradle plugin written in Kotlin/Java? 解决方法:Android Gradle插件仅支持Kotlin Gradle插件版本。 - How to solve: The Android Gradle plugin supports only Kotlin Gradle plugin version 1.3.40 and higher Gradle 插件不得包含版本 - Gradle plugin must not include version 如何从奥利奥版本降级到棉花糖? - How to downgrade from version from Oreo to Marshmallow? 如何在 Gradle Kotlin DSL 中使用来自 gradle.properties 的插件版本? - How to use plugin version from gradle.properties in Gradle Kotlin DSL? 如何解决此错误:数据绑定注释处理器版本需要匹配 Android Gradle 插件版本 - How can I solve this error : Data Binding annotation processor version needs to match the Android Gradle Plugin version
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM