Gradle:使第三方jar可用于本地gradle存储库 [英] Gradle: Make a 3rd party jar available to local gradle repository
问题描述
目前,我正在测试Gradle作为Maven的替代方案。在我的项目中,有一些第三方的罐子,在任何(Maven)仓库中都没有。我现在的问题是,我怎么管理它将这些罐子安装到我的本地.gradle存储库中。 (如果可能,我不想使用本地Maven仓库,因为Gradle应该独立运行。)目前,由于缺少罐子,我得到了很多例外。在Maven中,运行install命令非常简单。但是,我的谷歌搜索与Maven安装命令类似的东西并不成功。有没有人有想法?
您可以将您的文件系统JAR依赖包括为:
依赖项{
运行时文件('libs / a.jar','libs / b.jar')
运行时fileTree(dir:'libs ',包括:'* .jar')
}
/ testCompile /等等。
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?
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:使第三方jar可用于本地gradle存储库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!