2
0

More than 3 years have passed since last update.

#Scala: vol2: 【akka-grpcでgoogle/protobuf/*.proto をimportする方法】

Last updated at Posted at 2020-04-30

#Scala: vol2: 【akka-grpcでgoogle/protobuf/*.proto をimportする方法】

問題

akka-grpcで開発時に、
google/protobuf/*.proto のimportができずに、

sbt-console
Import "google/protobuf/timestamp.proto" was not found or had errors
"google.protobuf.Timestamp" is not defined.

となってしまったので、その解決策についてご紹介します。

解決策

Find the ones you need in protocolbuffers/protobuf:src/google/protobuf@master , download and put them alongside your projects' .proto resources

ダウンロードして、プロジェクトの.protoリソースと並べて配置

と書いてありましたが、 もっと簡単に対応可能です。

build.sbt に以下を追加すれば解決です。

libraryDependencies ++= Seq(
  "com.google.protobuf" % "protobuf-java" % "3.6.1" % "protobuf"
)
2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0