We noticed that when running a main method or a unit test from eclipse on a project that is managed by BuildShip and includes dependencies on other projects, all of the dependent project’s libraries end up on the classpath. This bypasses gradle’s depedency conflict resolution and we end up with duplicate but differing jar versions on the classpath.
As an example, I have posted a simple project here : https://github.com/petehayes/eclipse-dep-test
There is a project ‘c’, that depends on both project ‘a’ and ‘b’. ‘a’ and ‘b’ both declare a dependency on log4j but not the same version. Project ‘c’ then depends on both of them. Inspecting the gradle dependencies, it properly only includes 1 version of the jar, and the ‘Project and External Dependencies’ container also shows just the 1 version of the jar. The problem is that if you right click and run the Main class via an eclipse run configuration, it will print out the classpath that eclipse gives it, showing both versions of the jar.
log4j-1.2.15.jar mail-1.4.jar activation-1.1.jar log4j-1.2.14.jar
Is there some way to only get the gradle resolved libraries and ignore any of the dependent project’s libraries?