Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exclude some .proto files while using compileMavenTypes #118

Open
flipp5b opened this issue Feb 1, 2022 · 1 comment
Open

Exclude some .proto files while using compileMavenTypes #118

flipp5b opened this issue Feb 1, 2022 · 1 comment

Comments

@flipp5b
Copy link

flipp5b commented Feb 1, 2022

I have a Maven artifact containing .proto files only (without pre-compiled classes). I want to generate classes from this protos in my project (project itself doesn't have own .proto files). So, I use <compileMavenTypes>direct</compileMavenTypes> and <includeStdTypes>true</includeStdTypes> (protos from the artifact includes some standard Google's protos). Everything is great but plugin generates classes for all dependencies including protobuf-java (which already contains pre-compiled classes) and this leads to class duplication.

Probably, this is not a big issue (since classes are the same), but I wonder if there is any way to exclude some protos from code generation?

@JHahnHRO
Copy link

JHahnHRO commented Dec 7, 2023

Probably, this is not a big issue (since classes are the same)

It is a problem, because they're not the same. The StringValue.class in protobuf-java.jar contains the StringValue.of(String) method that is not present if one simply passes StringValue.proto to protoc!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants