Search code examples
javagradlejar

How to install a compiled by Gradle jar into the local Gradle Repository files-2.1 instead of the Maven repository?


In my build.gradle, I added the plugin:

apply plugin: 'maven'

Then using gradle install I can copy the resulted jar into the maven repository : ~/.m2/repository

However, my Gradle repository resides in ~/.gradle/caches/modules-2/files-2.1. How can I install the jar into this repository?


Solution

  • What worked for me is gradle install -Dmaven.repo.local=the/path/of/the/folder.

    I don't know which IDE you are using but in eclipse you can add a new Run Configuration, in Gradle taks add install and in program arguments -Dmaven.repo.local=the/path/of/the/folder.