gradle版本为5.2.1
➜  gradle_java git:(master) ✗ ./gradlew build -x test             

FAILURE: Build failed with an exception.

* What went wrong:
org/gradle/api/attributes/LibraryElements
> org.gradle.api.attributes.LibraryElements

解决方法:使用5.6版本以上的gradle
修改gradle-wrapper.properties中的

distributionUrl=https\://services.gradle.org/distributions/gradle-6.2-all.zip

gradle工程中引入protobuf
plugins {
id 'com.google.protobuf' version "0.8.12"
id 'java'
}

protobuf {
generatedFilesBaseDir = "$projectDir/src/generated/"
protoc {
path = '/usr/bin/protoc'
}
}
 

相关文章:

  • 2021-04-18
  • 2022-01-02
  • 2021-06-30
  • 2021-12-05
  • 2022-12-23
  • 2021-09-25
  • 2021-08-14
猜你喜欢
  • 2021-07-06
  • 2021-10-26
  • 2021-11-11
  • 2021-08-16
  • 2021-08-31
相关资源
相似解决方案