Gradle dependency from Maven local
<p>I would like to add a maven dependency in my gradle, but what I did didn't work. In my project gradle I put the code below to give my local maven repository url</p>

<pre><code>buildscript {
    repositories {
        maven { url "${System.env.HOME}/.m2/repository" }
        mavenCentral()
    }
}
</code></pre>

<p>Then in my app gradle I tried to add my dependency with</p>

<pre><code>compile 'my.package.name:lib:version'
</code></pre>

<p>But I got an error and I can't figure out what to do</p>

<pre><code>Error:Could not find my.package.name:lib:version.
</code></pre>

<p>When I launch a maven clean install, I get the path </p>

<pre><code>C:\Home\.m2\repository\my\package\name\lib\version\lib-version.pom
</code></pre>

<p>Does someone know what I'm missing or what to do ?</p>