How to solve problem with compile protobuf in scala project on Windows10?

660 Views Asked by At

I have simple code with example protobuf on scala

proto file

syntax = "proto3";

package grpc.example;

message HelloRequest {
  string msg = 1;
  int32 code = 2;
}


message HelloResponse {
  string msg = 1;
}

service HelloWorld {
  rpc hello (HelloRequest) returns (HelloResponse);
}

plugins.sbt in project folder

addSbtPlugin("com.thesamet" % "sbt-protoc" % "1.0.0")

libraryDependencies += "com.thesamet.scalapb" %% "compilerplugin" % "0.10.10"

build.sbt


name := "custom-grpc"

version := "0.1"

scalaVersion := "2.13.4"


lazy val protoExample = (project in file("proto-example"))
  .settings(

    PB.targets in Compile := Seq(
      scalapb.gen() -> (sourceManaged in Compile).value / "scalapb"
    ),
    libraryDependencies ++= Seq(
      "com.thesamet.scalapb" %% "scalapb-runtime" % scalapb.compiler.Version.scalapbVersion % "protobuf"
    ),
    scalaVersion := "2.13.4"
  )


lazy val root = (project in file("."))
  .aggregate(protoExample)

When in sbt shell call command compile I have error

[info] Compiling schema C:\Users\<.....>\IdeaProjects\LearnScala\custom-grpc\proto-example\src\main\protobuf\hello.proto
Error: Could not find or load main class protocbridge.frontend.BridgeApp
--jvm_0_out: protoc-gen-jvm_0: Plugin failed with status code 1.

What is error ??? I am use Windows10 and jdk 1.8 and then jdk 11.

0

There are 0 best solutions below