Separate repos for java-library and java-client. How to test library changes in local?

We have a repository just for internal libraries. I converted that to Gradle and I am using the ‘java-library’ plugin.

We have several client repositories (also moving to Gradle) dependent on this library repository. In maven world, if i want to test library changes on my local; I would run mvn install which builds the library jars and store it in the .m2 folder. Then when I build the client app it would pickup those jars from .m2 folder.

How to do this in Gradle? When I run ‘gradle build’ on the library it does not seem to store the artifacts in the .gradle folder.

Do I have to publishToMavenLocal on the library and then use mavenLocal() in the client app?

Using publishToMavenLocal and mavenLocal() is a workable solution (I used it for many years and still do for a number of projects).

However, composite builds are likely a better solution these days. For example, from the command line you can substitute the client app’s library dependency with a local copy of the library’s build:

./gradlew --include-build path/to/library/source/directory build

Thank you Chris. Composite builds do look like the gradle intended solution for doing this.