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

Documentation refers to wrong maven plugin #892

Open
stephen-smith opened this issue Aug 7, 2020 · 2 comments
Open

Documentation refers to wrong maven plugin #892

stephen-smith opened this issue Aug 7, 2020 · 2 comments

Comments

@stephen-smith
Copy link

https://github.com/scalapb/ScalaPB/blob/49a3b59ae811b7e3bd7f286e44dc77efcd575f21/docs/src/main/markdown/faq.md#how-do-i-use-scalapb-with-maven

It says "protobuf-maven-plugin" in two places, but that plugin doesn't (yet) was any support for scala. Instead the correct plugin is "protoc-jar-maven-plugin". The example code (https://github.com/thesamet/scalapb-maven-example/blob/fa3eb585bbbb3e20c461aefbe821e0e75e922eb4/pom.xml#L125) also refers the the wrong plugin in XML comment: "Add protobuf-maven-plugin and provide ScalaPB [...]".

It's confusing, and since I was already using protobuf-maven-plugin it implied some compatibility that was not there; the plugs differ in where they load *.proto files from, on where the output source files to, and how to specify artifacts in a OS-independent way so that I can use the same pom.xml on the (Linux) docker images used by our CI and the (MS Windows) laptops used by other developers on the project.

@thesamet
Copy link
Contributor

thesamet commented Aug 7, 2020

Hi @stephen-smith , thanks for reporting this.

In fact, you can still use protobuf-maven-plugin, but there's caveat: it doesn't support passing options (like grpc or flat_package) into ScalaPB. If you look at a previous revision, you can see how it was used: thesamet/scalapb-maven-example@b8fd20c#diff-600376dffeb79835ede4a0b285078036 - protobuf-maven-plugin also doesn't require os-dependent artifacts.

If you don't need to pass custom options to the plugin it should be ok to use protobuf-maven-plugin. There is an open issue there to enable passing custom options here - feel free to drop a line there: xolstice/protobuf-maven-plugin#56

I'll leave this issue open to address the documentation issues you pointed out, and revisit our maven support options in case there was any improvement in any of the possibilities.

@stephen-smith
Copy link
Author

Thanks for the quick reply! Unfortunately, I do need to generate gRPC stubs as well, but I'll still look over that previous version and the issue you linked.

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