While importing a Gradle project with IntelliJ IDEA the resulting classpath contains different versions of multiple Java libraries.
How to avoid that?
While importing a Gradle project with IntelliJ IDEA the resulting classpath contains different versions of multiple Java libraries.
How to avoid that?
If Gradle is doing that you probably should not prevented this unless you fully understand why it is doing so.
There are several reasons why multiple versions are necessary, for instance your build process has plugins that require different versions of a library.
One plugin could be developed by a vendor and other by a random team some place and they have different requirements. Some times even your own app could ask for that, like in cases where you are building components that may run in an environment with multiple class loaders, a classic example is OSGi.
Bottom line, if it is not interfering with your work, just leave them there, something requested that version. For your app itself, you are able to define your dependencies and have control of the required versions.
Normally depending on the authors of a lid a minor version number difference may signify huge API changes, and multiple versions are the only way to make the pieces fit together. Not necessarily only for your app, but also for your building. Not mentioning here the dependency inheritance that may add up.