Eclipse plugin does not include transitive dependencies in classpath

(awarrenlove) #1

I have encountered a problem with the Gradle Eclipse plugin that it does not include transitive dependencies in the classpath, causing the error in Eclipse “The type cannot be resolved. It is indirectly referenced from required .class files.” Is this expected behavior or do I have something set up improperly?

Right now I have worked around the issue by putting the line compile project(":project").configurations.compile.getAllDependencies() in the dependencies so it will get all the transitive dependencies that way.

(Peter Niederwieser) #2

Transitive dependencies should (and normally do) work correctly. If we are talking about project A depending on project B depending on external libraries, then A should have a project dependency on B in Eclipse, and the libraries of B should be marked as exported.

(awarrenlove) #3

I see how it’s supposed to work now. That’s my misunderstanding about how Eclipse works I guess, and how it finds the different dependencies of other projects.