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

**URL:** <https://discuss.gradle.org/t/separate-repos-for-java-library-and-java-client-how-to-test-library-changes-in-local/40262>\
**Category:** Help/Discuss\
**Created:** [June 19, 2021, 12:42am UTC](https://discuss.gradle.org/t/separate-repos-for-java-library-and-java-client-how-to-test-library-changes-in-local/40262 "2021-06-19T00:42:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Caiman](https://avatars.discourse-cdn.com/v4/letter/c/dec6dc/32.png) [@Caiman](https://discuss.gradle.org/u/Caiman)\
**Post date:** [June 19, 2021, 12:42am UTC](https://discuss.gradle.org/t/separate-repos-for-java-library-and-java-client-how-to-test-library-changes-in-local/40262/1 "2021-06-19T00:42:52Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Chris\_Dore](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/chris_dore/32/7592_2.png) [@Chris\_Dore](https://discuss.gradle.org/u/Chris_Dore)\
**Post date:** [June 19, 2021, 5:45am UTC](https://discuss.gradle.org/t/separate-repos-for-java-library-and-java-client-how-to-test-library-changes-in-local/40262/2 "2021-06-19T05:45:25Z")

</div>

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](https://docs.gradle.org/current/userguide/composite_builds.html) 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
```

---

<div class="post-metadata">

**Author:** ![Caiman](https://avatars.discourse-cdn.com/v4/letter/c/dec6dc/32.png) [@Caiman](https://discuss.gradle.org/u/Caiman)\
**Post date:** [June 21, 2021, 4:06am UTC](https://discuss.gradle.org/t/separate-repos-for-java-library-and-java-client-how-to-test-library-changes-in-local/40262/3 "2021-06-21T04:06:38Z")

</div>

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