To automatically generate Scala case classes for your messages add ScalaPB's
sbt plugin to your project. Create a file named
project/scalapb.sbt containing the following lines:
Add the following line to your
ScalaPB will look for protocol buffer (
.proto) files under
src/main/protobuf, which can be customized. Running the
compile command in sbt will generate Scala
sources for your protos and compile them.
For additional configuration options, see ScalaPB SBT Settings.
If you would like to compile protocol buffers into Scala outside SBT, you can use scalapbc (ScalaPB compiler).
Using ScalaPBC, you can get maven to generate the code for you. Check out the ScalaPB Maven example.
Read about the Generated Code.