In order to have the good classpath in eclipse, I use the eclipse plugin (https://docs.gradle.org/current/userguide/eclipse_plugin.html) that merges the classpaths of the different configurations.
In my case, the merge classpaths are from : testRuntime, compileClasspath, testCompileClasspath, runCompileClasspath.
My problem is that sometimes in 2 different configurations (usually compile and another one), I have the same dependency but with a different version. At the end, I have the duplication in the file “.classpath”. For exemple commons-io in version 2.4 AND in 2.5.
What I want is to keep the version needed for the compile configuration.
As I understood, I can modify/filter the classpath generated in the function “whenMerged” of the plugin. The fonction provides as an argument the merged classpath. I wanted to find the dependency duplications in it and then remove the wrong one. Unfortunatly I have no idea which one is from the compile configuration and which one is from another configuration. The dependencies given in the classpath are of type https://docs.gradle.org/current/javadoc/org/gradle/plugins/ide/eclipse/model/Library.html and I can’t find this information in it.
Do you have any suggestion to do what I want to do?
Thanks for you help.
Pierre