javamavendependenciesivygradle

Gradle - getting the latest release version of a dependency


What would be the easiest way to tell Gradle the following:

Retrieve 'junit' dependency and take its latest 'release' version.

Managing Maven and Ivy repositories is sort of new to me. I tried the following steps and they result in Could not resolve dependency ... error:

Maybe I misunderstand something. Why would getting the latest version of the dependency be such a hard task?


Solution

  • Gradle currently does not support Maven's RELEASE (which is rarely used and deprecated) but it does support Ivy's latest.release (and for snapshots latest.integration). However, the general recommendation is to build against exact versions. Otherwise, the build can become a lottery.