gradleApi depenency ignored in root project


Is use following dependency in the build.gradle file of my project A

dependencies {
api gradleApi()
api localGroovy()


which works fine for building that project A.

But when I use the jar of that project A as dependency in another project B , it downloads all other dependencies declared in the build.gradle file of project A , but not that gradle api which leads to errors for the methods using that api.

Any advice ?