buildscript { dependencies { classpath 'com.github.ben-manes:gradle-versions-plugin:0.17.0' } } apply plugin: 'com.github.ben-manes.versions'
gradlew dependencyUpdates -Drevision=release
It lists the dependencies and possible newer versions.
What I learned
- Be
careful, with the result of dependencyUpdates, while it is not hundred percent accurate.
- It also can happen, that there are indirect dependencies between your
libraries. In case of you need to get detailed information about the
dependency hierarchy, you can use Gradle's dependency tree command.
gradlew dependencies
Unfortunately at the time of writing this post, there is no Eclipse support for the hierarchy tree. - Sometimes it is not even possible to use the latest version of a
library. For example in case of Powermock, you need to check the
compatibility page first
https://github.com/powermock/powermock/wiki/Mockito - Due
to indirect dependencies, it is not always possible to change to the
latest version of a library directly. Simple defining the latest version can cause problems in Eclipse build or in the Gradle build process.
In order to solve the problem, you need to exclude previous version of a given library used by another one. Excluding in Gradle looks like this:
compile(
'org.springframework.boot:spring-boot-starter-test'
) {
exclude group:
'org.mockito'
, module:
'mockito-core'
}
Nincsenek megjegyzések:
Megjegyzés küldése