How To Check Dependencies Updates
To check if Gradle dependencies are up-to-date, you can use the Gradle Versions Plugin.
This Gradle plugin lists all the dependencies declared in the build.gradle.kts
file, and tells whether they are up-to-date or if a new version is available.
Configure the Project
Edit your build.grate.kts
file to declare the Gradle Versions Plugin plugin in addition to
the MicroEJ plugin:
plugins {
id("com.microej.gradle.application") version "0.20.0"
id("com.github.ben-manes.versions") version "0.51.0"
}
In order to be able to check dependencies, you must disable Version Check option in the microej
block:
microej {
...
dependenciesVersionsCheckEnabled = false
}
Some dependencies are automatically included by the MicroEJ Gradle plugin to compile the project with JDT:
- org.eclipse.jdt:org.eclipse.jdt.compiler.apt:1.3.1000
- org.eclipse.jdt:org.eclipse.jdt.core:3.22.
These dependencies are not relevant for the report. To remove them, you can add the following snippet to the build file:
tasks.withType<DependencyUpdatesTask> {
configurations.all {
exclude(group = "org.eclipse.jdt")
}
}
If your default Gradle configuration does not fetch plugins from Gradle Plugin Portal, you can add this repository to settings.gradle.kts
:
pluginManagement {
repositories {
gradlePluginPortal()
}
}
Generate the Report
Once these prerequisites are fulfilled, the report can be generated by calling the dependenciesUpdates
task in help
group:
From the command line interface:
$ ./gradlew dependenciesUpdates
A simple text report is printed in the console and generated in build/dependenciesUpdates/report.txt
.
Report is configurable in the plugin. Refer to the Report Format section of the plugin README.
Here is an example of report:
------------------------------------------------------------
: Project Dependency Updates (report to plain text file)
------------------------------------------------------------
The following dependencies are using the latest milestone version:
- com.github.ben-manes.versions:com.github.ben-manes.versions.gradle.plugin:0.51.0
- com.is2t.tools:application-repository:2.2.0
- com.microej.veeport.st.stm32f7508-dk:M5QNX_eval:2.2.0
- ej.library.eclasspath:stringtokenizer:1.2.0
The following dependencies exceed the version found at the milestone revision level:
- ej.library.ui:widget [5.2.0 <- 4.2.0]
The following dependencies have later milestone versions:
- com.microej.gradle.application:com.microej.gradle.application.gradle.plugin [0.15.0 -> 0.20.0]
- com.microej.test:junit-test-engine [0.2.2 -> 0.3.0]
- ej.api:drawing [1.0.2 -> 1.0.5]
- ej.api:edc [1.3.5 -> 1.3.7]
- ej.api:microui [3.1.0 -> 3.5.0]
- ej.library.eclasspath:collections [1.4.0 -> 1.4.2]
- ej.library.runtime:basictool [1.5.0 -> 1.7.0]
- ej.library.runtime:service [1.1.1 -> 1.2.0]
- ej.library.test:junit [1.7.1 -> 1.10.0]
Gradle release-candidate updates:
- Gradle: [8.3 -> 8.10.2]