Status: New
Owner: liuj...@google.com
Labels: Type-Defect Priority-Medium
New issue 432 by jsill...@gmail.com: descriptor.proto should be bundled in
the Jar distribution of the protobuf library
http://code.google.com/p/protobuf/issues/detail?id=432
What steps will reproduce the problem?
1. Download or compile the Java protobuf library Jar package
2. Run "jar tf protobuf.jar"
3. Observe that descriptor.proto is not packaged in the Jar file
What is the expected output? What do you see instead?
The plugin for integrating protobufs into a Maven build has a nice feature
where it unpacks .proto files from dependent Jar files and automatically
adds them to its protoc's --proto_path invocation. This allows Java
projects to bundle and "publicize" .proto definitions for use by others.
I'm currently working on a library that handles transforms between JSON
content and protobuf objects, and I have a need to define messages that
contain DescriptorProto fields. Having descriptor.proto included in the
official Jar file would eliminate the need to copy the .proto source into
my own project.
What version of the product are you using? On what operating system?
Protobuf 2.4.1, Maven 3.0.3
Please provide any additional information below.
This is easy to accomplish by adding the following bits of configuration to
the pom.xml:
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
<executions>
<execution>
<id>copy-resources</id>
<phase>validate</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${basedir}/src/main/resources</outputDirectory>
<resources>
<resource>
<directory>../src/google/protobuf/</directory>
<includes>
<include>descriptor.proto</include>
</includes>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
--
You received this message because you are subscribed to the Google Groups "Protocol
Buffers" group.
To post to this group, send email to protobuf@googlegroups.com.
To unsubscribe from this group, send email to
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/protobuf?hl=en.