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
Java generated code for plugin.proto not available in a protobuf artifact #182
Comments
This was still true as of the latest released version: 2.6.1 |
In C++, generated code of plugin.proto is included in libprotoc which is used by whoever need to write a compiler plugin. In Java though, there isn't an equivalent of C++'s libprotoc and it's not recommended to write the plugin in Java as well. For this reason I think we'll not provide any Java artifact for plugin.proto. |
Hi Feng, There are many users of java plugins for protoc. There's also a maven plugin that launches them: http://sergei-ivanov.github.io/maven-protoc-plugin/examples/protoc-plugin.html This is the standard maven plugin for compiling protos with maven, and it supports java based protoc plugins. However, any java plugin has to manually compile the plugin.proto into java, and package that with the plugin code (which is not as nice has having it be an artifact that is generated from the standard protobuf distribution). Previous commits to the plugin.proto support to support java package naming have been committed, here: All that's remaining is to have a compiled version of this proto appear either in the java runtime jar, or in a separately generated 'plugin support' jar. The easiest path would be to just add it to the java runtime (in the same way that several other compiled protos are included, e.g.): https://github.com/google/protobuf/blob/master/java/pom.xml#L84 Alternately, a nice helper library was also developed, which could be nice to include in 'plugin support' jar (linked to by @jhump above). |
@xfxyjwf Yes, it would be nice if all EDIT: if implemented, this obviously needs to be a separate artifact, not part of |
FYI. The latest protobuf-java artifacts now include the generated code of plugin.proto (and a bunch of others). |
A little note of appreciation. I've just picked the latest protobuf beta up, and I could finally delete generated classes for |
See original issue from old googlecode issue tracker:
https://code.google.com/p/protobuf/issues/detail?id=185
Related: it would be nice to get this set of helper classes in, too:
https://codereview.appspot.com/912042
They may not make sense in the protobuf runtime JAR, but maybe in a separate artifact that also includes generated Java code for plugin.proto?
The text was updated successfully, but these errors were encountered: