在构建时使用gradle在项目中包含本地jar文件 [英] Including local jar file in project at build time using gradle

查看:539
本文介绍了在构建时使用gradle在项目中包含本地jar文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在构建时使用gradle
在我的项目中包含salesforce的enterprise.jar文件任何人都可以帮我解决如何在项目的src / main / resources文件夹中包含本地jar文件。

I want to include enterprise.jar file of salesforce in my project at build time using gradle Could anyone help me out how to include a local jar file that exists in src/main/resources folder in my project.

推荐答案

这在文档。以下是应该做的:

This is explained in the documentation. The following should do:

dependencies {
    compile files('./src/main/resources/enterprise.jar')
}

我不会把jar放在 src / main / resources ,但是。它不是您项目的资源,而是编译依赖项。我会把它放在lib目录中。

I wouldn't put the jar in src/main/resources though. It's not a resource of your project, but a compile dependency. I would put it in a lib directory.

这篇关于在构建时使用gradle在项目中包含本地jar文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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