Projects with same name cannot refer to each other


(stardolphin) #1

If you have two projects with the same name (but different paths), Gradle allows the build but you cannot refer to each other

for example: Project 1: :consumer:impl Project 2: :producer:impl

if you have a compile time dependency in producer like:

compile project(":consumer:impl")

It will not be on the classpath of producer. If you change the name so they are unique, they will be.

I cannot tell if this is specific to the java platform or not, and a work-around is to change the name, but if we are allowing projects with different paths and the same name, to have the java project fail like it does (no error, just missing from the classpath) is just… confusing.


(Luke Daley) #2

Hi,

I’m not able to reproduce this. Would you be able to provide a cutdown sample with the problem?


(stardolphin) #3

Hmm, When I did it as a simple project, I no longer see the problem, but we have it reproducible in our main codeline (that is, the project is missing from the classpath even though it is in the gradle file, and if we rename the project it goes away). But since our main project is on the order of a hundred subprojects, it wouldn’t be easy to cut away to a working demo :frowning:

I’ll play around with it and see if I can get a test project to exhibit the functionality.