Same named projects in different folders does not work

I have a projects structure

   |  api
   |  modules
     \  api

Both ‘api’ modules has it’s gradle files. :src:api project declares dependency to :src:modules:api.

Gradle 2.10 fails with error
Module version :api:SNAPSHOT, configuration ‘compileCopy’ declares a dependency on configuration ‘default’ which is not declared in the module descriptor for :api:SNAPSHOT

Rename of modules:api to modules:api2 makes it work