简体   繁体   English

使用gradle在构建时在项目中包含本地jar文件

[英]Including local jar file in project at build time using gradle

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

This is explained in the documentation . 这在文档中有解释。 The following should do: 以下应该做:

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

I wouldn't put the jar in src/main/resources though. 我不会把jar放在src/main/resources It's not a resource of your project, but a compile dependency. 它不是项目的资源,而是编译依赖项。 I would put it in a lib directory. 我会把它放在一个lib目录中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM