Can I override parent poms property of a dependency?

Hi there,
I have a maven dependency: org.apache.flink:flink-shaded-hadoop-2-uber:2.8.3-10.0 that defines it version as: ${hadoop.version}-10.0 and property hadoop.version lives in parent pom. Surprisingly hadoop.version value is 2.4.1 instead of 2.8.3. This results an error:

> Could not resolve org.apache.flink:flink-shaded-hadoop-2:2.8.3-10.0.
     Required by:
         project :cleverdata-dmpkit-customerjourney-hdfs-sink-job-impl_2.11
      > Could not resolve org.apache.flink:flink-shaded-hadoop-2:2.8.3-10.0.
         > inconsistent module metadata found. Descriptor: org.apache.flink:flink-shaded-hadoop-2:2.4.1-10.0 Errors: bad version: expected='2.8.3-10.0' found='2.4.1-10.0'
      > Could not resolve org.apache.flink:flink-shaded-hadoop-2:2.8.3-10.0.
         > inconsistent module metadata found. Descriptor: org.apache.flink:flink-shaded-hadoop-2:2.4.1-10.0 Errors: bad version: expected='2.8.3-10.0' found='2.4.1-10.0'

How can I leverage gradle to override hadoop.version property to 2.8.3? Or may be there is another way I can make this dependency properly resolve?

Thanks forward!

1 Like

There is no easy way of doing it as far as I know. You can either use io.spring.dependency-management or override versions with resolutionStrategy block Managing Dependencies for Spring Projects with Gradle by Jenn Strater and Andy Wilkinson - YouTube. The title is misleading since it can be applied to any kind of project: Spring, standalone, Android, etc. I would be really glad if Gradle team finally address this functionality.