Question on “compile project()” Gradle task?

$ ./gradlew -v

------------------------------------------------------------
Gradle 3.4.1
------------------------------------------------------------

In Gradle dependencies{} how does the compile project(":someProject") task work?

dependencies {
   compile project(":someProject")
   ...
}

I mean I know if I have that, it will compile that project first, then build my project. But does my project use the artifacts, e.g., JAR files, produced by that project locally, instead of getting them from an artifact repo like Nexus for example? Does it use the Gradle cache in ~/.gradle/...

Thanks

Besides that I really wonder you are using an ancient Gradle version (current is 7.0), yes someProject will be built first and its artifacts added to the compile configuration (which is deprecated since years and now removed in 7.0).
There are for sure things in ~/.gradle/ used during that, but not a cache for the artifact I think.

1 Like