Plugin for Gradle to check update your project dependencies ...
It works quite similar to the Enforcer plugin for Maven.
The simplest way to apply the plugin to your Gradle build is to use the plugin mechanism:
plugins {
id "com.bisnode.versioncheck" version "<version>"
}
The plugin comes with two tasks:
-
versionCheck - Run the version checks against the project. The build fails, if violations are found.
-
versionCheckReport - Create a report of the checks for all projects and configrations.
Specify the set of modules that should have the same version
versionCheck {
sameVersionGroups = [ "org.springframework", "org.springframework.boot", "com.fasterxml.jackson.*" ]
}
The groups are groups in the sense of Maven artifact group IDs. Wildcards ("*") and placeholders ("?") are supported.
There are two main modes, you can use only the declared dependencies or additionally the transitive dependencies:
- declared - only first level dependencies are included
- transitive - the declared and all transitive dependencies (default)
Configuration example:
versionCheck {
dependencies = 'transitive'
}
To further customize which dependencies are analyzed, you can specify configurations, for example to include the dependencies that are only needed for tests with the Java plugin:
versionCheck {
configurations 'testRuntime' // this is the default
}
Tip: If there are dependencies showing up you have no idea where they are coming from, use gradle dependencies
to get an overview of all configurations and the dependencies contained in them. Use it to identifiy the configurations that you want to include.
If you have a multi-build project that you want to treat as one single project, you should apply the plugin only to the root project and configure the plugin to include dependencies from sub-projects as well:
versionCheck {
includeSubProjects = true
}
The MIT license (see the LICENSE file)