[
https://issues.apache.org/jira/browse/MESOS-1203?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13975716#comment-13975716
]
Tobi Knaup commented on MESOS-1203:
-----------------------------------
Thanks for investigating this Ben. Building separate jars with separate proto
versions is definitely cleaner but I do think shading solves the problem. The
shade plugin does two things:
- include code from the conflicting jar in the uber jar under a new namespace
- change the namespace at all call sites
So the generated Java code will always use the packaged, shaded protobuf. It
doesn't matter which other Protobuf versions are available on the class path
(or if there are any at all).
I tried compiling the Java protos with 2.4.1 and the rest of the project with
2.5.0 as you suggested, but I'm running into trouble. Will spend a bit more
time on it.
> Shade protobuf dependency in Mesos Java library
> -----------------------------------------------
>
> Key: MESOS-1203
> URL: https://issues.apache.org/jira/browse/MESOS-1203
> Project: Mesos
> Issue Type: Improvement
> Components: build
> Reporter: Patrick Wendell
>
> Mesos's Java library uses the protobuf library which is also used by Hadoop.
> Unfortunately the protobuf library does not provide binary compatiblity
> between minor versions (for code compiled against 2.4.1 and 2.5.0 cannot run
> together in a single JVM classlaoder) .
> This makes use of Mesos via it's Java API, something that is required for
> Spark and I'm assuming other frameworks, fundamentally incompatible for
> certain Hadoop versions.
> Mesos could shade this jar using the maven shade plug-in. Take a look at the
> Parquet project for an example of shading:
> https://github.com/Parquet/parquet-format/blob/master/pom.xml#L140
> Without this fix Java users won't be able to use Mesos (< 0.17) with newer
> versions of Hadoop. Or Mesos 0.17+ with older versions of Hadoop.
--
This message was sent by Atlassian JIRA
(v6.2#6252)