# Inherit dependency versions from a pom file

**URL:** <https://discuss.gradle.org/t/inherit-dependency-versions-from-a-pom-file/13377>\
**Category:** Help/Discuss\
**Created:** [December 18, 2015, 8:20pm UTC](https://discuss.gradle.org/t/inherit-dependency-versions-from-a-pom-file/13377 "2015-12-18T20:20:05Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alex\_Sko](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/alex_sko/32/83_2.png) [@Alex\_Sko](https://discuss.gradle.org/u/Alex_Sko)\
**Post date:** [December 18, 2015, 8:20pm UTC](https://discuss.gradle.org/t/inherit-dependency-versions-from-a-pom-file/13377/1 "2015-12-18T20:20:05Z")

</div>

I have an existing pom.xml file which has dependencyManagement version. this file is deployed to a central repository (Nexus-like) used by multiple projects throughout the company.  
multiple maven projects refer to that pom file as “parent”.  
then they declare dependencies without specifying their versions because those come from the parent pom file.

now I want to create a Gradle project that could use that pom.xml file to inherit dependency versions as well. is that possible?  
for now I can ignore build plugins or dependencies declared in that parent, I’m mostly interested in inheriting specific version numbers plus maybe properties coming from the parent pom.xml file.

e.g. if the parent pom.xml file says “when you use Apache libraryX, you should use version Y” and then I can declare in my build.gradle file:

1. refer to this pom file in the central repository
2. use Apache LibraryX without specifying version number - because that will come from the pom file

---

<div class="post-metadata">

**Author:** ![jwachter](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/jwachter/32/3971_2.png) [@jwachter](https://discuss.gradle.org/u/jwachter)\
**Post date:** [December 18, 2015, 10:34pm UTC](https://discuss.gradle.org/t/inherit-dependency-versions-from-a-pom-file/13377/2 "2015-12-18T22:34:20Z")

</div>

Hi Alex,

I think currently the option to directly do that is to use the plugin the Spring project created to enable the usage of Bill-of-Material (BOM) POM descriptors in a gradle build.

You might find some information in the inaugural blog post [1] and the Github project [2].

[1] [https://spring.io/blog/2015/02/23/better-dependency-management-for-gradle](https://spring.io/blog/2015/02/23/better-dependency-management-for-gradle)  
[2] [https://github.com/spring-gradle-plugins/dependency-management-plugin](https://github.com/spring-gradle-plugins/dependency-management-plugin)

---

<div class="post-metadata">

**Author:** ![mark\_vieira](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/mark_vieira/32/5396_2.png) [@mark\_vieira](https://discuss.gradle.org/u/mark_vieira)\
**Post date:** [December 18, 2015, 11:20pm UTC](https://discuss.gradle.org/t/inherit-dependency-versions-from-a-pom-file/13377/3 "2015-12-18T23:20:28Z")

</div>

Neflix has open sourced their plugin to do this as well.

> **[nebula-plugins/nebula-dependency-recommender-plugin](https://github.com/nebula-plugins/nebula-dependency-recommender-plugin)**
>
> nebula-dependency-recommender-plugin - Leave off version numbers in your dependencies section and have versions recommended by several possible sources.

---

<div class="post-metadata">

**Author:** ![Alex\_Sko](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/alex_sko/32/83_2.png) [@Alex\_Sko](https://discuss.gradle.org/u/Alex_Sko)\
**Post date:** [December 20, 2015, 6:46pm UTC](https://discuss.gradle.org/t/inherit-dependency-versions-from-a-pom-file/13377/4 "2015-12-20T18:46:23Z")

</div>

thanks a lot! I used “io.spring.gradle” and it worked just fine!

---

<div class="post-metadata">

**Author:** ![jim\_hurne](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/jim_hurne/32/10451_2.png) [@jim\_hurne](https://discuss.gradle.org/u/jim_hurne)\
**Post date:** [March 12, 2019, 6:54pm UTC](https://discuss.gradle.org/t/inherit-dependency-versions-from-a-pom-file/13377/5 "2019-03-12T18:54:23Z")

</div>

Support for this is now natively available in Gradle 5, and is fully realized in Gradle 5.2.1.

See the [java-platform plugin documentation](https://docs.gradle.org/current/userguide/java_platform_plugin.html) for details.
