Compiling to Proto3, need Proto2
See original GitHub issueI have a proto file for proto 2.6.1. It must compile to proto 2.6.
However, when I do a compile, it looks like the generated Java is for proto3 …
I find this in the generated java
com.google.protobuf.GeneratedMessageV3
I am getting lots of compiler failures, because GeneratedMessageV3
is not found (which makes sense since I am using proto-java 2.6.1.
In my sbt, I have this…
PB.targets in Compile := Seq(
PB.gens.java("2.6.1") -> (sourceManaged in Compile).value
)
In the proto file, I have…
syntax = "proto2";
Is there something I am doing incorrectly?
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Language Guide | Protocol Buffers - Google Developers
When you run the protocol buffer compiler on a .proto , the compiler generates ... It's possible to import proto3 message types and...
Read more >Compiling proto2 syntax file with proto3 compiler
I have a proto file written in proto2 syntax. I am compiling this proto file using proto3 compiler. Although it bulids successfully, ...
Read more >using proto3 for receiving proto2 messages ("group", C#)
I want to code my application to consume their data in C#. So I was trying to use proto3 to compile their .proto...
Read more >Hi there, I work on the protobuf team at Google. A friendly note ...
Proto2 schemas will support extensions forever (even after Protobuf 3.0), so there's no need to avoid extensions. You are only using proto3 schemas...
Read more >Protocol Buffer Compiler Installation - gRPC
While not mandatory, gRPC applications often leverage Protocol Buffers for service definitions and data serialization.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks! Looks like this works!
FYI, this is the PR I just posted for our repo - https://github.com/vinyldns/vinyldns/pull/113
Correct, this plugin depends on https://github.com/os72/protoc-jar which ships with many different versions of protoc. Currently 3.5.1 is the default version. Also, you can set
PB.runProtoc
if you wantsbt-protoc
to use a locally installed protoc instead.