Gradle无法检测osdetector插件 [英] Gradle not able to detect osdetector plugin
问题描述
我读过 documetation ,其中提到我们应该按照 link 。
我在build.gradle文件中包含了osdetector插件。
但是当我构建项目时,gradle无法解析osdetector插件并抛出错误
>无法应用插件[id'com.google.protobuf']
>未找到id为'osdetector'的插件。
我的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()
}
依赖项{
classpath'com.google.protobuf:protobuf-gradle-plugin:0.7.3'
classpath'com.google.gradle:osdetector- gradle-plugin:1.4.0'
}
}
protobuf {
protoc {
// protoc的版本必须匹配protobuf-java。如果你不直接依赖
// protobuf-java,那么你将会依赖于grpc所依赖的
// protobuf-java版本。
artifact =com.google.protobuf:protoc:3.0.0-beta-2
}
插件{
grpc {
artifact ='io.grpc :protoc-gen-grpc-java:0.12.0'
}
}
generateProtoTasks {
all()*。plugins {
grpc {}
generatedFilesBaseDir =$ projectDir / src / generated
}
sourceCompatibility = 1.8
储存库{
mavenCentral()
}
依赖项{
testCompile组:'junit',名称:'junit',版本:'4.11'
编译'io.grpc :grpc-all:0.12.0'
compileorg.neo4j:neo4j:$ {neo4jVersion}
compileorg.neo4j:neo4j-ogm-core:2.0.1
编译org.neo4j:neo4j-ogm-http-driver:2.0.1
compile'com.google.apis:google-api-services-storage:v1-rev71-1.22.0'
编译'com.fasterxml.jackson.core:jackson-core:2.7.3'
compile'com.fasterxml.jackson.core:jacks on-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 与osdetector-gradle-plugin-1.4不兼容。 0,因为该版本更改了插件的名称。交换到版本osdetector 1.2.1应该解决问题。
I am using OpenSSL for my Java GRPC project which uses gradle.
I read the documetation which mentions that we should make security settings as mentioned in this link.
I have included the osdetector plugin in the build.gradle file.
But when I build the project, gradle is not able to resolve the osdetector plugin and throwing error
> Failed to apply plugin [id 'com.google.protobuf']
> Plugin with id 'osdetector' not found.
My gradle file is as follows:
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
}
The compile dependency alone is getting resolved however.
I think I am missing something basic here. Please let me know the solution.
Updated
protobuf-gradle-plugin is not compatible with osdetector-gradle-plugin-1.4.0, since that version changed the name of the plugin. Swapping to version osdetector 1.2.1 should fix the problem.
这篇关于Gradle无法检测osdetector插件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!