gradle-bintray-plugin 插件 [id: 'com.jfrog.bintray', version: '1.+'] 未找到

gradle-bintray-plugin Plugin [id: 'com.jfrog.bintray', version: '1.+'] was not found

我正在尝试使用 gradle 插件 gradle-bintray-plugin

目前正在使用 Gradle 4.4

下面the tutorial in the github page我应该这样添加插件:

plugins {
    ...
    id "com.jfrog.bintray" version "1.+"
}

我收到此错误消息并且无法继续:

Plugin [id: 'com.jfrog.bintray', version: '1.+'] was not found in any of the following sources:

  • Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
  • Plugin Repositories (dynamic plugin versions are not supported) Open File

我刚找到解决办法。看起来它只适用于指定您要使用的确切版本。

所以改变这个:

plugins {
    ...
    id "com.jfrog.bintray" version "1.+"
}

为此:

plugins {
    ...
    id "com.jfrog.bintray" version "1.8.4" // exact version!
}

现在可以使用了!

动态版本可能在过去被授权用于 plugins 块(如教程中给出的示例)但现在 it's forbidden

if (versionSelectorScheme.parseSelector(markerVersion).isDynamic()) {
    result.notFound(SOURCE_NAME, "dynamic plugin versions are not supported");
    return;
}

但旧的 buildscript 方式并非如此,下面的代码在 Gradle 4.10

下工作正常
buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.+'
    }
}