You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ratis.apache.org by Danielle Hu <dh...@snaplogic.com> on 2021/08/09 16:52:11 UTC

How to generate java file for custom proto

Hi there,
I got a question of generating java files for custom photo. Right now I use google’s protoc to generate java files from my custom .proto file. But I then have to manually change ‘com.google.protobuf’ to ‘org.ratis.thirdparty.com.google.protobuf’ since it could not detect com.google.protobuf is the same as the ratis third party one. Is there a way to make this convenient? Like a ratis.thirdparty.protoc ? Or how did ratis build those proto java files?

Sincerely,
Danielle

Re: How to generate java file for custom proto

Posted by Tsz Wo Sze <sz...@gmail.com>.
Hi Danielle,

You may use maven-shade-plugin (
https://maven.apache.org/plugins/maven-shade-plugin/) to shade your code,
i.e. it renames your package.  You may take a look at the pom.xml file in
the rafis-proto module.

Tsz-Wo

On Tue, Aug 10, 2021 at 8:36 AM Danielle Hu <dh...@snaplogic.com> wrote:

> Hi there,
> I got a question of generating java files for custom photo. Right now I
> use google’s protoc to generate java files from my custom .proto file. But
> I then have to manually change ‘com.google.protobuf’ to ‘
> org.ratis.thirdparty.com.google.protobuf’ since it could not detect
> com.google.protobuf is the same as the ratis third party one. Is there a
> way to make this convenient? Like a ratis.thirdparty.protoc ? Or how did
> ratis build those proto java files?
>
> Sincerely,
> Danielle