Gradle 无法检测到 osdetector 插件

Gradle not able to detect osdetector plugin

我正在为我的 Java GRPC 项目使用 OpenSSL,该项目使用 gradle.

我读了documetation which mentions that we should make security settings as mentioned in this link

我在 build.gradle 文件中包含了 osdetector 插件。

但是当我构建项目时,gradle 无法解析 osdetector 插件并抛出错误

> Failed to apply plugin [id 'com.google.protobuf']
   > Plugin with id 'osdetector' not found.

我的gradle文件如下:

def neo4jVersion = "2.3.3"

apply plugin: 'application'
apply plugin: 'java'
apply plugin: 'com.google.protobuf'
apply plugin: 'idea'
apply plugin: 'com.google.osdetector'

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.google.protobuf:protobuf-gradle-plugin:0.7.3'
        classpath 'com.google.gradle:osdetector-gradle-plugin:1.4.0'
    }
}

protobuf {
    protoc {
        // The version of protoc must match protobuf-java. If you don't depend on
        // protobuf-java directly, you will be transitively depending on the
        // protobuf-java version that grpc depends on.
        artifact = "com.google.protobuf:protoc:3.0.0-beta-2"
    }
    plugins {
        grpc {
            artifact = 'io.grpc:protoc-gen-grpc-java:0.12.0'
        }
    }
    generateProtoTasks {
        all()*.plugins {
            grpc {}
        }
    }
    generatedFilesBaseDir = "$projectDir/src/generated"
}

sourceCompatibility = 1.8

repositories {
    mavenCentral()
}

dependencies {
    testCompile group: 'junit', name: 'junit', version: '4.11'
    compile 'io.grpc:grpc-all:0.12.0'
    compile "org.neo4j:neo4j:${neo4jVersion}"
    compile "org.neo4j:neo4j-ogm-core:2.0.1"
    compile "org.neo4j:neo4j-ogm-http-driver:2.0.1"
    compile 'com.google.apis:google-api-services-storage:v1-rev71-1.22.0'
    compile 'com.fasterxml.jackson.core:jackson-core:2.7.3'
    compile 'com.fasterxml.jackson.core:jackson-annotations:2.7.3'
    compile 'com.fasterxml.jackson.core:jackson-databind:2.7.3'
    compile 'io.netty:netty-tcnative-boringssl-static:1.1.33.Fork14:' + osdetector.classifier
}

然而,单独的编译依赖性正在得到解决。

我想我在这里遗漏了一些基本的东西。请告诉我解决方案。

已更新

protobuf-gradle-plugin is not compatible 和 osdetector-gradle-plugin-1.4.0,因为那个版本更改了插件的名称。切换到版本 osdetector 1.2.1 应该可以解决问题。