In a Gradle project, how do I ensure that the downloaded Maven dependency libraries are compiled with the compatible Java version used in my project? I’m using Java version 17 in the project, but if a library downloaded from the Maven repository is compiled with Java 19, I encounter an “UnsupportedClassVersionError.” How can I prevent this in a Gradle project?
Is there any plugin available to automatically check and fail the build with the detailed report?
Currently, I’m getting below error which is not so useful.
Execution failed for task ':sample:analyzeJarMain'.
> Unsupported class file major version 63
At least, I would like to know which dependency (or library) causing this issue.