如何将由Gradle jar编译的文件安装到本地Gradle存储库文件-2.1中而不是Maven存储库中? [英] How to install a compiled by Gradle jar into the local Gradle Repository files-2.1 instead of the Maven repository?

查看:72
本文介绍了如何将由Gradle jar编译的文件安装到本地Gradle存储库文件-2.1中而不是Maven存储库中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的build.gradle中,添加了插件:

In my build.gradle, I added the plugin:

apply plugin: 'maven'

然后使用"gradle install",可以将生成的jar复制到maven存储库中:〜/.m2/repository

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

但是,我的Gradle存储库位于〜/.gradle/caches/modules-2/files-2.1.如何将jar安装到此存储库中?

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

推荐答案

对我有用的是 gradle install -Dmaven.repo.local = the/path/of/the/folder .

我不知道您使用的是哪个IDE,但是在eclipse中您可以添加新的运行配置,在Gradle taks中添加 install 和程序参数 -Dmaven.repo.local =/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.

这篇关于如何将由Gradle jar编译的文件安装到本地Gradle存储库文件-2.1中而不是Maven存储库中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆