0

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.

vkj
  • 138
  • 1
  • 7
  • 1
    I would recommend to keep the transitive dependencies as they are cause you might not know if those are working correctly together... – khmarbaise Jun 15 '18 at 09:25
  • 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 Jun 19 '18 at 10:10

1 Answers1

1

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

J Fabian Meier
  • 33,516
  • 10
  • 64
  • 142