In a gradle multi-project configuration, when a project depends on several others who share different versions of same dependencies, all those versions are present in the classpath when running a test in eclipse (4.5.1 with buildship 1.0.5).
eg. in the following multiproject
project |-- project1 | |-- log4j 1.2.14 |-- project2 | |-- log4j 1.2.17 |-- project-tests | |-- project(':project1') | |-- project(':project2')
Then when running a test in eclipse, test classpath in
project-tests project will include both
log4j-1.2.17. Obviously it leads to runtime issues dependending on which version comes first in classpath.
While when running tests with
gradle test, only the younger version will show up (as I would expect).
A self-contained example using gradle-2.8 is available on https://github.com/Starch/idea_wrong_classpath (problem appears also on idea, hence the project name). Just launch
Note that the classpath in project properties seems correct (project1 and project2 do not export their deps and project-tests have only log4j-1.2.17). But when I run a test both
log4j versions are in classpath.