Issue 432 in protobuf: descriptor.proto should be bundled in the Jar distribution of the protobuf library

48 views
Skip to first unread message

prot...@googlecode.com

unread,
Nov 3, 2012, 3:25:10 PM11/3/12
to prot...@googlegroups.com
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>

Reply all
Reply to author
Forward
0 new messages