私はgradleを使用しているJava GRPCプロジェクトにOpenSSLを使用しています。osdetectorプラグインを検出できません
documetationは、このlinkに記載されているセキュリティ設定を行う必要があることを示しています。
osdetectorプラグインをbuild.gradleファイルに含めました。
しかし、私はプロジェクトをビルドするとき、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
}
だけで、コンパイルの依存関係を取得していますしかし、解決しました。
ここでは基本的なものが欠けていると思います。私に解決策を教えてください。そのバージョンは、プラグインの名前を変更するので
は、
どのバージョンのgradleを使用していますか? Googleのprotobufプラグインには、少なくともGradle 12が必要です。ビルドスクリプトで[wrapper]タスクをオーバーライドすることで、使用するグラデルバージョンを指定できます([here](https://docs.gradle.org/current/userguide/gradle_wrapperを参照)。 html))。この変更の後、 'gradle wrapper'を使ってラッパーを再度生成する必要があります。そして、あなたのプロジェクトルートに' gradlew build'を使ってそれぞれのGradleバージョンでプロジェクトをビルドすることができます。 – dpr
私は実際に最初のエラーが 'プラグイン[id 'com.google.protobuf']'を適用するのに失敗したと思われるので、Gradleのバージョンを求めています... – dpr
Thanks dpr ..... gradleバージョンはdistributionUrl = https \://services.gradle.org/distributions/gradle-2.9-bin.zip。私はそれをdistributionUrl = https \://services.gradle.org/distributions/gradle-2.12-bin.zipに変更しました。しかしそれは問題を解決しませんでした。これが私が変更されるはずだった右のグラデルバージョンであれば教えてください。 >プラグインの適用に失敗しました[id 'com.google.protobuf'] > com.google.protobuf.gradle.ProtobufSourceDirectorySet_Decoratedタイプのインスタンスを作成できませんでした。 –