Search code examples
grailsgradledependenciesversiongrails-3.0

How does grails/gradle download the dependencies without version specification


In Grails 3 project we are using some dependencies as below. For the plugin or dependencies which has version it downloads as per version specification from remote repository. We assumed it is downloading the latest dependency available when we did not mention version, but when we checked the hibernate dependency it is downloading '4.3.10.6' version in the project whereas remote repository has latest version. So how does grails or gradle download dependencies without version?

compile "org.grails.plugins:hibernate"
compile "org.grails.plugins:cache"
compile "org.hibernate:hibernate-ehcache"
compile "org.grails.plugins:scaffolding"

compile "org.webjars:bootstrap:3.3.5"
compile "org.webjars:bootstrap-tagsinput:0.5"

Note : We don't have any errors or issues with this in our project


Solution

  • If no version is specified, Gradle will use transitive dependency management, starting with the Gradle version number, and the packages that that Gradle version depends on. If transitive dependency management doesn't care. Then Gradle will search through the hierarchy of repositories and flat files and flat trees and dependent projects and take the latest version.