Re: Avoid guava version conflict with hbase by shading

2018-01-22 Thread Mark Prins

On 21-01-18 08:21, Debraj Manna wrote:

Mark

One more query if some other dependency (let's say elasticsearch for
example) leaks its usage of guava then it may happen I end up again with
two incompatible versions of guava. What is the recommended way of handling
this?


You would need to find and settle on a guava version that is compatible 
between all the versions or get the other projects to release updated 
versions or make a version by yourself (of hbase or elasticsearch or...) 
that is compatible


-M


-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



Re: Avoid guava version conflict with hbase by shading

2018-01-21 Thread Debraj Manna
Mark

One more query if some other dependency (let's say elasticsearch for
example) leaks its usage of guava then it may happen I end up again with
two incompatible versions of guava. What is the recommended way of handling
this?

Thanks,


On Sun, Jan 21, 2018 at 3:19 AM, Mark Prins  wrote:

> That's the idea, you cannot otherwise control which classes or which
> version of guava are loaded by the classloader at runtime.
>
> Op 20 jan. 2018 14:55 schreef "Debraj Manna" :
>
> Ok. But then I think I have to change the import of guava in all the places
> in my code?
>
> On Sat, Jan 20, 2018 at 1:44 PM, Mark Prins  wrote:
>
> > You could try shading the new guava to a different package and use that
> in
> > your code.
> > E.g. jena-shaded-guava does that
> >
> > Op 20 jan. 2018 09:02 schreef "Debraj Manna" :
> >
> > > Mark
> > >
> > > hbase and hadoop is using the old guava. Is there a way I can use the
> > > latest guava in my code and let hadoop and hbase use the old guava.
> > >
> > > On 20-Jan-2018 1:19 PM, "Mark Prins"  wrote:
> > >
> > > > It seems that the guava versions are not API compatible, so shading
> is
> > > > unlikely to help. You will need to downgrade to a compatible version
> of
> > > > guava or get the other projects to upgrade.
> > > > -M
> > > >
> > > > Op 20 jan. 2018 07:51 schreef "Debraj Manna" <
> subharaj.ma...@gmail.com
> > >:
> > > >
> > > > I have posted more details in stackoverflow
> > > >  > > > conflict-with-hbase-testing-util-1-2>.
> > > > I could not add all the details here because of size limitation.
> > > >
> > > > In a project I am using Guava 23.5 but some of the dependencies
> > (hadoop &
> > > > hbase) are using old Guava 14. This is causing an exception during
> > > runtime
> > > >
> > > > As mentioned here  > to-shade-or-not-to-shade>
> > > I
> > > > tried to shade the Hbase dependency in a new module named shadedcdh.
> > > > pom.xml
> > > > looks like below
> > > >
> > > > ?xml version="1.0" encoding="UTF-8"?>
> > > >
> > > > http://maven.apache.org/POM/4.0.0";
> > > >  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
> > > >  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> > > > http://maven.apache.org/xsd/maven-4.0.0.xsd";>
> > > > 
> > > > main
> > > > com.vnera
> > > > 0.001-SNAPSHOT
> > > > 
> > > > 4.0.0
> > > >
> > > > shaded-cdh
> > > > jar
> > > >
> > > > 
> > > > 
> > > > org.apache.hbase
> > > > hbase-testing-util
> > > > 1.2.0-cdh5.7.0
> > > > 
> > > > 
> > > > org.apache.hadoop
> > > > hadoop-client
> > > > ${hadoop.version}
> > > > 
> > > > 
> > > > org.apache.hadoop
> > > > hadoop-common
> > > > ${hadoop.version}
> > > > 
> > > > 
> > > > org.apache.hbase
> > > > hbase-client
> > > > 
> > > > 1.2.0-cdh5.7.0
> > > > 
> > > > 
> > > >
> > > > 
> > > > 
> > > > 
> > > > org.apache.maven.plugins
> > > > maven-shade-plugin
> > > > 2.4.1
> > > > 
> > > > 
> > > > package
> > > > 
> > > > shade
> > > > 
> > > > 
> > > > 
> > > > 
> > > > com.google.common > pattern>
> > > >
> > > > shaded.com.google.common
> > > > 
> > > > 
> > > > 
> > > >  > > > implementation="org.apache.maven.plugins.shade.resource.
> > > > ManifestResourceTransformer"
> > > > />
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > >
> > > > 
> > > > 
> > > > cloudera
> > > > https://repository.cloudera.com/artifactory/
> > > > cloudera-repos/
> > > > 
> > > > 
> > > > 
> > > > 
> > > >
> > > > I excluded hbase and hadoop dependency from my project and added
> > > > shadedcdh as dependency. But this is still giving me the same
> > > > exception. The dependency tree I have posted in the stackoverflow. I
> > > > could not post here because of size limitation. Can someone let me
> > > > know how can I avoid the conflict?
> > > >
> > >
> >
>


Re: Avoid guava version conflict with hbase by shading

2018-01-20 Thread Mark Prins
That's the idea, you cannot otherwise control which classes or which
version of guava are loaded by the classloader at runtime.

Op 20 jan. 2018 14:55 schreef "Debraj Manna" :

Ok. But then I think I have to change the import of guava in all the places
in my code?

On Sat, Jan 20, 2018 at 1:44 PM, Mark Prins  wrote:

> You could try shading the new guava to a different package and use that in
> your code.
> E.g. jena-shaded-guava does that
>
> Op 20 jan. 2018 09:02 schreef "Debraj Manna" :
>
> > Mark
> >
> > hbase and hadoop is using the old guava. Is there a way I can use the
> > latest guava in my code and let hadoop and hbase use the old guava.
> >
> > On 20-Jan-2018 1:19 PM, "Mark Prins"  wrote:
> >
> > > It seems that the guava versions are not API compatible, so shading is
> > > unlikely to help. You will need to downgrade to a compatible version
of
> > > guava or get the other projects to upgrade.
> > > -M
> > >
> > > Op 20 jan. 2018 07:51 schreef "Debraj Manna"  >:
> > >
> > > I have posted more details in stackoverflow
> > >  > > conflict-with-hbase-testing-util-1-2>.
> > > I could not add all the details here because of size limitation.
> > >
> > > In a project I am using Guava 23.5 but some of the dependencies
> (hadoop &
> > > hbase) are using old Guava 14. This is causing an exception during
> > runtime
> > >
> > > As mentioned here  to-shade-or-not-to-shade>
> > I
> > > tried to shade the Hbase dependency in a new module named shadedcdh.
> > > pom.xml
> > > looks like below
> > >
> > > ?xml version="1.0" encoding="UTF-8"?>
> > >
> > > http://maven.apache.org/POM/4.0.0";
> > >  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
> > >  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> > > http://maven.apache.org/xsd/maven-4.0.0.xsd";>
> > > 
> > > main
> > > com.vnera
> > > 0.001-SNAPSHOT
> > > 
> > > 4.0.0
> > >
> > > shaded-cdh
> > > jar
> > >
> > > 
> > > 
> > > org.apache.hbase
> > > hbase-testing-util
> > > 1.2.0-cdh5.7.0
> > > 
> > > 
> > > org.apache.hadoop
> > > hadoop-client
> > > ${hadoop.version}
> > > 
> > > 
> > > org.apache.hadoop
> > > hadoop-common
> > > ${hadoop.version}
> > > 
> > > 
> > > org.apache.hbase
> > > hbase-client
> > > 
> > > 1.2.0-cdh5.7.0
> > > 
> > > 
> > >
> > > 
> > > 
> > > 
> > > org.apache.maven.plugins
> > > maven-shade-plugin
> > > 2.4.1
> > > 
> > > 
> > > package
> > > 
> > > shade
> > > 
> > > 
> > > 
> > > 
> > > com.google.common pattern>
> > >
> > > shaded.com.google.common
> > > 
> > > 
> > > 
> > >  > > implementation="org.apache.maven.plugins.shade.resource.
> > > ManifestResourceTransformer"
> > > />
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > >
> > > 
> > > 
> > > cloudera
> > > https://repository.cloudera.com/artifactory/
> > > cloudera-repos/
> > > 
> > > 
> > > 
> > > 
> > >
> > > I excluded hbase and hadoop dependency from my project and added
> > > shadedcdh as dependency. But this is still giving me the same
> > > exception. The dependency tree I have posted in the stackoverflow. I
> > > could not post here because of size limitation. Can someone let me
> > > know how can I avoid the conflict?
> > >
> >
>


Re: Avoid guava version conflict with hbase by shading

2018-01-20 Thread Debraj Manna
Ok. But then I think I have to change the import of guava in all the places
in my code?

On Sat, Jan 20, 2018 at 1:44 PM, Mark Prins  wrote:

> You could try shading the new guava to a different package and use that in
> your code.
> E.g. jena-shaded-guava does that
>
> Op 20 jan. 2018 09:02 schreef "Debraj Manna" :
>
> > Mark
> >
> > hbase and hadoop is using the old guava. Is there a way I can use the
> > latest guava in my code and let hadoop and hbase use the old guava.
> >
> > On 20-Jan-2018 1:19 PM, "Mark Prins"  wrote:
> >
> > > It seems that the guava versions are not API compatible, so shading is
> > > unlikely to help. You will need to downgrade to a compatible version of
> > > guava or get the other projects to upgrade.
> > > -M
> > >
> > > Op 20 jan. 2018 07:51 schreef "Debraj Manna"  >:
> > >
> > > I have posted more details in stackoverflow
> > >  > > conflict-with-hbase-testing-util-1-2>.
> > > I could not add all the details here because of size limitation.
> > >
> > > In a project I am using Guava 23.5 but some of the dependencies
> (hadoop &
> > > hbase) are using old Guava 14. This is causing an exception during
> > runtime
> > >
> > > As mentioned here  to-shade-or-not-to-shade>
> > I
> > > tried to shade the Hbase dependency in a new module named shadedcdh.
> > > pom.xml
> > > looks like below
> > >
> > > ?xml version="1.0" encoding="UTF-8"?>
> > >
> > > http://maven.apache.org/POM/4.0.0";
> > >  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
> > >  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> > > http://maven.apache.org/xsd/maven-4.0.0.xsd";>
> > > 
> > > main
> > > com.vnera
> > > 0.001-SNAPSHOT
> > > 
> > > 4.0.0
> > >
> > > shaded-cdh
> > > jar
> > >
> > > 
> > > 
> > > org.apache.hbase
> > > hbase-testing-util
> > > 1.2.0-cdh5.7.0
> > > 
> > > 
> > > org.apache.hadoop
> > > hadoop-client
> > > ${hadoop.version}
> > > 
> > > 
> > > org.apache.hadoop
> > > hadoop-common
> > > ${hadoop.version}
> > > 
> > > 
> > > org.apache.hbase
> > > hbase-client
> > > 
> > > 1.2.0-cdh5.7.0
> > > 
> > > 
> > >
> > > 
> > > 
> > > 
> > > org.apache.maven.plugins
> > > maven-shade-plugin
> > > 2.4.1
> > > 
> > > 
> > > package
> > > 
> > > shade
> > > 
> > > 
> > > 
> > > 
> > > com.google.common pattern>
> > >
> > > shaded.com.google.common
> > > 
> > > 
> > > 
> > >  > > implementation="org.apache.maven.plugins.shade.resource.
> > > ManifestResourceTransformer"
> > > />
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > >
> > > 
> > > 
> > > cloudera
> > > https://repository.cloudera.com/artifactory/
> > > cloudera-repos/
> > > 
> > > 
> > > 
> > > 
> > >
> > > I excluded hbase and hadoop dependency from my project and added
> > > shadedcdh as dependency. But this is still giving me the same
> > > exception. The dependency tree I have posted in the stackoverflow. I
> > > could not post here because of size limitation. Can someone let me
> > > know how can I avoid the conflict?
> > >
> >
>


Re: Avoid guava version conflict with hbase by shading

2018-01-20 Thread Mark Prins
You could try shading the new guava to a different package and use that in
your code.
E.g. jena-shaded-guava does that

Op 20 jan. 2018 09:02 schreef "Debraj Manna" :

> Mark
>
> hbase and hadoop is using the old guava. Is there a way I can use the
> latest guava in my code and let hadoop and hbase use the old guava.
>
> On 20-Jan-2018 1:19 PM, "Mark Prins"  wrote:
>
> > It seems that the guava versions are not API compatible, so shading is
> > unlikely to help. You will need to downgrade to a compatible version of
> > guava or get the other projects to upgrade.
> > -M
> >
> > Op 20 jan. 2018 07:51 schreef "Debraj Manna" :
> >
> > I have posted more details in stackoverflow
> >  > conflict-with-hbase-testing-util-1-2>.
> > I could not add all the details here because of size limitation.
> >
> > In a project I am using Guava 23.5 but some of the dependencies (hadoop &
> > hbase) are using old Guava 14. This is causing an exception during
> runtime
> >
> > As mentioned here 
> I
> > tried to shade the Hbase dependency in a new module named shadedcdh.
> > pom.xml
> > looks like below
> >
> > ?xml version="1.0" encoding="UTF-8"?>
> >
> > http://maven.apache.org/POM/4.0.0";
> >  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
> >  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> > http://maven.apache.org/xsd/maven-4.0.0.xsd";>
> > 
> > main
> > com.vnera
> > 0.001-SNAPSHOT
> > 
> > 4.0.0
> >
> > shaded-cdh
> > jar
> >
> > 
> > 
> > org.apache.hbase
> > hbase-testing-util
> > 1.2.0-cdh5.7.0
> > 
> > 
> > org.apache.hadoop
> > hadoop-client
> > ${hadoop.version}
> > 
> > 
> > org.apache.hadoop
> > hadoop-common
> > ${hadoop.version}
> > 
> > 
> > org.apache.hbase
> > hbase-client
> > 
> > 1.2.0-cdh5.7.0
> > 
> > 
> >
> > 
> > 
> > 
> > org.apache.maven.plugins
> > maven-shade-plugin
> > 2.4.1
> > 
> > 
> > package
> > 
> > shade
> > 
> > 
> > 
> > 
> > com.google.common
> >
> > shaded.com.google.common
> > 
> > 
> > 
> >  > implementation="org.apache.maven.plugins.shade.resource.
> > ManifestResourceTransformer"
> > />
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> >
> > 
> > 
> > cloudera
> > https://repository.cloudera.com/artifactory/
> > cloudera-repos/
> > 
> > 
> > 
> > 
> >
> > I excluded hbase and hadoop dependency from my project and added
> > shadedcdh as dependency. But this is still giving me the same
> > exception. The dependency tree I have posted in the stackoverflow. I
> > could not post here because of size limitation. Can someone let me
> > know how can I avoid the conflict?
> >
>


Re: Avoid guava version conflict with hbase by shading

2018-01-20 Thread Debraj Manna
Mark

hbase and hadoop is using the old guava. Is there a way I can use the
latest guava in my code and let hadoop and hbase use the old guava.

On 20-Jan-2018 1:19 PM, "Mark Prins"  wrote:

> It seems that the guava versions are not API compatible, so shading is
> unlikely to help. You will need to downgrade to a compatible version of
> guava or get the other projects to upgrade.
> -M
>
> Op 20 jan. 2018 07:51 schreef "Debraj Manna" :
>
> I have posted more details in stackoverflow
>  conflict-with-hbase-testing-util-1-2>.
> I could not add all the details here because of size limitation.
>
> In a project I am using Guava 23.5 but some of the dependencies (hadoop &
> hbase) are using old Guava 14. This is causing an exception during runtime
>
> As mentioned here  I
> tried to shade the Hbase dependency in a new module named shadedcdh.
> pom.xml
> looks like below
>
> ?xml version="1.0" encoding="UTF-8"?>
>
> http://maven.apache.org/POM/4.0.0";
>  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/xsd/maven-4.0.0.xsd";>
> 
> main
> com.vnera
> 0.001-SNAPSHOT
> 
> 4.0.0
>
> shaded-cdh
> jar
>
> 
> 
> org.apache.hbase
> hbase-testing-util
> 1.2.0-cdh5.7.0
> 
> 
> org.apache.hadoop
> hadoop-client
> ${hadoop.version}
> 
> 
> org.apache.hadoop
> hadoop-common
> ${hadoop.version}
> 
> 
> org.apache.hbase
> hbase-client
> 
> 1.2.0-cdh5.7.0
> 
> 
>
> 
> 
> 
> org.apache.maven.plugins
> maven-shade-plugin
> 2.4.1
> 
> 
> package
> 
> shade
> 
> 
> 
> 
> com.google.common
>
> shaded.com.google.common
> 
> 
> 
>  implementation="org.apache.maven.plugins.shade.resource.
> ManifestResourceTransformer"
> />
> 
> 
> 
> 
> 
> 
> 
>
> 
> 
> cloudera
> https://repository.cloudera.com/artifactory/
> cloudera-repos/
> 
> 
> 
> 
>
> I excluded hbase and hadoop dependency from my project and added
> shadedcdh as dependency. But this is still giving me the same
> exception. The dependency tree I have posted in the stackoverflow. I
> could not post here because of size limitation. Can someone let me
> know how can I avoid the conflict?
>


Re: Avoid guava version conflict with hbase by shading

2018-01-19 Thread Mark Prins
It seems that the guava versions are not API compatible, so shading is
unlikely to help. You will need to downgrade to a compatible version of
guava or get the other projects to upgrade.
-M

Op 20 jan. 2018 07:51 schreef "Debraj Manna" :

I have posted more details in stackoverflow
.
I could not add all the details here because of size limitation.

In a project I am using Guava 23.5 but some of the dependencies (hadoop &
hbase) are using old Guava 14. This is causing an exception during runtime

As mentioned here  I
tried to shade the Hbase dependency in a new module named shadedcdh. pom.xml
looks like below

?xml version="1.0" encoding="UTF-8"?>

http://maven.apache.org/POM/4.0.0";
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd";>

main
com.vnera
0.001-SNAPSHOT

4.0.0

shaded-cdh
jar



org.apache.hbase
hbase-testing-util
1.2.0-cdh5.7.0


org.apache.hadoop
hadoop-client
${hadoop.version}


org.apache.hadoop
hadoop-common
${hadoop.version}


org.apache.hbase
hbase-client

1.2.0-cdh5.7.0






org.apache.maven.plugins
maven-shade-plugin
2.4.1


package

shade




com.google.common

shaded.com.google.common














cloudera
https://repository.cloudera.com/artifactory/cloudera-repos/





I excluded hbase and hadoop dependency from my project and added
shadedcdh as dependency. But this is still giving me the same
exception. The dependency tree I have posted in the stackoverflow. I
could not post here because of size limitation. Can someone let me
know how can I avoid the conflict?