Gradle:使 3rd 方 jar 可用于本地 gradle 存储库 [英] Gradle: Make a 3rd party jar available to local gradle repository

查看:30
本文介绍了Gradle:使 3rd 方 jar 可用于本地 gradle 存储库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前,我正在测试 Gradle 作为 Maven 的替代品.在我的项目中,有一些 3rd 方 jars,它们在任何 (Maven) 存储库中都不可用.我现在的问题是,我如何才能将这些 jar 安装到我的本地 .gradle 存储库中.(如果可能,我不想使用本地 Maven 存储库,因为 Gradle 应该独立运行.)目前,由于缺少 jars,我收到了很多异常.在 Maven 中,运行 install 命令非常简单.但是,我在 Google 上搜索类似于 Maven 安装命令的内容没有成功.有人有想法吗?

currently, I'm testing Gradle as an alternative to Maven. In my projects, there are some 3rd party jars, which aren't available in any (Maven) repositories. My problem is now, how could I manage it to install these jars into my local .gradle repository. (If it's possible, I don't want to use the local Maven repository, because Gradle should run independently.) At the moment, I get a lot of exceptions because of missing jars. In Maven, it's quite simple by running the install command. However, my Google search for something similar to the Maven install command wasn't successful. Has anybody an idea?

推荐答案

您可以将文件系统 JAR 依赖项包含为:

you can include your file system JAR dependencies as:

dependencies {
    runtime files('libs/a.jar', 'libs/b.jar')
    runtime fileTree(dir: 'libs', include: '*.jar')
}

您可以更改编译/测试编译/等的运行时..

you may change runtime for compile/testCompile/etc..

这篇关于Gradle:使 3rd 方 jar 可用于本地 gradle 存储库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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