0
votes

I have a project using various hadoop libraries, in which I want to have all dependencies from group "org.apache.hadoop" to have same version i.e. 2.7.6, for even the transitive dependencies.

E.g. hive-hcatalog-core:jar:2.3.2 - depends on hadoop-mapreduce-client-core:jar:2.7.2 , but I want 2.7.6 version of hadoop-mapreduce-client-core to be used explicitly. Similary for many libraries within org.apache.hadoop.

Edit - I made my stuff work by adding such conflicting dependencies explicitly in my pom.But I was wondering if we could enforce something like this.

1
I would recommend to keep the transitive dependencies as they are cause you might not know if those are working correctly together... - khmarbaise
yeah, I agree to your point. But in some cases where I am directly using hadoop-mapreduce-client-core library. I dont want to downgrade to 2.7.2. - vkj

1 Answers

1
votes

If you really want to change the transitive dependencies (see khmarbaise's comment), you can do so with <dependencyManagement>. It allows you to define the version of all dependencies, including transitive ones.

See e.g.

differences between dependencymanagement and dependencies in maven