flink-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sebastian Kunert <skuner...@gmail.com>
Subject Re: Flink Maven Configuration
Date Fri, 14 Nov 2014 12:36:27 GMT
Thanks for your answer.

I did already take a look at the documentation. We have the following code
snippet in our pom in flink-shade.

<artifactSet>
<includes>
<include>com.google.guava:guava</include>
</includes>
</artifactSet>
<relocations>
<relocation>
<pattern>com.google</pattern>
<shadedPattern>org.apache.flink.shaded.com.google</shadedPattern>
</relocation>
</relocations>

I first thought that the includes specify a whitelist of the packages to be
relocated, so from my understanding it would not be necessary to exclude
protobuf explicitly. Nevertheless, even the following change doesn't work.

<artifactSet>
<includes>
<include>com.google.guava:guava</include>
</includes>
<excludes>
<exclude>com.google.protobuf:*</exclude>
</excludes>
</artifactSet>
<relocations>
<relocation>
<pattern>com.google</pattern>
<shadedPattern>org.apache.flink.shaded.com.google</shadedPattern>
</relocation>
</relocations>

 Making the relocation part more specific solves the problem.

<relocation>
<pattern>com.google.guava</pattern>
<shadedPattern>org.apache.flink.shaded.com.google.guava</shadedPattern>
</relocation>


2014-11-14 10:22 GMT+01:00 Stephan Ewen <sewen@apache.org>:

> Hey Sebastian!
>
> I think there are two approaches:
>
>   - You can either shade the protobuf Classes as well
>
>   - or you can exclude the ptotobuf namespace from shading. Have a look at
> the shade plugin docs.
>
> Stephan
>  Am 14.11.2014 09:49 schrieb "Sebastian Kunert" <skunert49@gmail.com>:
>
> > Hi Guys,
> >
> > I am currently working on integrating Flink with Mesos. Therefore I
> > currently reuse the flink-yarn uberjar assembly to build a jar that
> > contains all the classes I need. Now I have a dependency on a Google
> > Protobuf class. I added protobuf as a dependency to my module and it is
> > also contained in the uberjar under /com/google/protobuf.
> >
> > Nevertheless, on execution I get the following error:
> > java.lang.ClassNotFoundException:
> > org.apache.flink.shaded.com.google.protobuf.ByteString
> >
> > The location org.apache.flink.shaded... is wrong. I understand this is
> > related to the maven shading plugin but after some looking into it I am
> not
> > sure how to fix this.
> >
> > Greetings,
> >
> > Sebastian
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message