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
Support protoc maven plugin #230
Comments
It needs to support extra params like: that seem to be plugin specific |
Who has the permission to push an update to Maven Central? |
more active fork is at github.com/dtrott/maven-protoc-plugin Maybe the best is to ask the 3 or 4 developers there if they would agree to a contributor agreement and we merge back the changes in this repo (or we start from a clean moved repo to github Google account? |
The maintainers of protobufs have permissions for com.google groupId in Maven repository. I will start a branch and pull the code of existing work. Thanks for starting a thread. |
Great! I'm happy to help, we need to make sure Googlers are backing and supporting long term this, i.e for any protoc changes, make sure the Maven plugin is up to date. |
Unfortunately, there's no good way to distribute the |
The gprc Java protoc plugin is also a native binary. On Wed, Mar 11, 2015 at 7:49 AM Sergei Ivanov notifications@github.com
|
Indeed it is, now that I've browsed the grpc codebase. Going forward, this is going to be another major PITA from the Maven integration point of view. Sure, one can put the binary on the |
Also, could anybody provide me a link to protobuf documentation, where it explains in greater detail how the protoc plugins are invoked and configured on the command line. I remember that I came across it before, but I cannot find it anymore. Any useful pointers will be greatly appreciated. Is the colon-separated list of parameters (as in the grpc example above) a generic way of passing parameters to protoc plugins, or is it something specific to grpc:
|
On Wed, Mar 11, 2015 at 12:46 PM, Sergei Ivanov notifications@github.com
|
Thanks, I did not realise it was buried inside C++ API documentation. Has the optional parameter always been there, even in protobuf v2? I.e. are v2 and v3 fully compatible in terms of command line interface? Is there some character escaping supported for the parameter? |
On Wed, Mar 11, 2015 at 4:21 PM, Sergei Ivanov notifications@github.com
Yes. This feature is available in v2 and it's not changed in v3.
No escaping is supported. protoc passes exactly the same char sequence it
|
@xiaofeng-gg Thanks a lot for your help. Now I have enough information to proceed with an implementation in my Maven plugin fork, and I hope I'll be able to conjure something up in the next few days. @ludoch I hold you to your promise of organising a proper takeover on Google side. We need to make sure it is done properly and that there will be a guaranteed continuity in development. Please contact me at sergei_ivanov@mail.ru if you'd like to discuss the detailed arrangements. |
@sergei-ivanov I talked with the gprc team about the idea to distribute protoc and grpc plugin binaries for multiple platforms for each release. Do you think this would make it easier for the maven plugin? e.g. pick up the binary for the specific platform. We can fall back to use an installed version if no pre-built binary is found for the target platform. |
On the one hand, On the other hand, Maven is still pretty rubbish in dealing with binary dependencies. Solving the problem purely by Maven means, one will probably need to create a bunch of profiles that are activated under different OSes, use those profiles to pull down the correct binary from the repository, then pass the path to that binary to maven protoc plugin. Alternatively, maven protoc plugin may attempt to detect the version of protobuf library in the dependencies, then detect the operating environment, then download the correct protoc native binary and use it. However, that does not solve the problem with other native binary protoc plugins, such as grpc. It is probably going to be unwieldy. Honestly, despite my extensive Maven experience, I do not know a good Maven way of dealing with versioned native binary dependencies that are part of the build process. Toolchains proved to have been the best (or rather, "the least worst") option for us so far. And then there is a harsh reality of working in large corporate environments (especially in the sectors like finance, where IT is not the core activity, and security and regulation reaches insane levels). Downloading of binaries is typically thwarted by corporate firewalls, and there is typically a blanket ban on accessing services like Bintray. Even worse, procuring gcc on a linux server may be an issue. I really wish there were a pure java version of protoc: that would have made life so much easier. IMHO, there may still be some benefit in deploying |
@pherl Actually, can you please ask |
@ejona86 and I have been working on a solution for This solution would also work for |
@sergei-ivanov Here is the freshly compiled grpc plugin for win32. |
Thanks, got it. I also took a look at the linked issue, and I think I'll be able to incorporate some ideas from there into the plugin. Unfortunately, with the way the plugin is structured now, introducing any new goals or settings makes the configuration even more unwieldy and confusing. I have a feeling that a major rewrite is imminent, but I guess we can still have a short term stop-gap solution. |
I actually managed to get it all to work with grpc. I still need to clean it up and document before pushing, but I'll try to get it done as soon as I can. @zhangkun83 Was the binary you gave me a debug version? Asking that because it's quite a large file at 500k. I am curious if you could do me a favour and produce a minimal optimised win32 binary plugin that would output an empty java class with the name matching the proto. If the exe file ends up being reasonably small (<100k) then I'll be able to add it to the integration test suite. |
No it's a release version. Unfortunately I don't have a windows machine. That one I gave you was built by my colleague. |
Related: os72/protoc-jar-maven-plugin#4 |
The plugin has a new home, and it is finally available in Maven Central. |
This is great news! Thanks a lot. |
Make workspace_deps.bzl overridable using maybe()
The original plugin is not maintained. Need to support it again: The original one is: https://code.google.com/p/protobuf/source/browse/#svn%2Fbranches%2Fmaven-plugin%2Ftools%2Fmaven-plugin
The text was updated successfully, but these errors were encountered: