How to point gardle to read from local .m2 directory rather than the remote artifactory

I am publishing a shared project dependency module to the local maven repo. I want to use the shared module from my local maven repo (./m2) for testing . But gradle build downloads the artifact from the remote artifactory into its cache.

Is there a way i can instruct gradle to pull my custom jar from local repo rather that remote ?

repositories {
   mavenLocal()
}