32

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.

Sonam Daultani
  • 749
  • 3
  • 11
  • 18
  • Hi, I guess you might be interested in reading http://gradle.1045684.n5.nabble.com/Possible-to-specify-my-own-classpath-entries-td1433673.html Hope this helps – Mark Bramnik Sep 25 '12 at 05:20
  • I just want to add the jar file in build path of project using gradle. This link doesn't provide any such info. Could you please provide further pointers. – Sonam Daultani Sep 25 '12 at 05:24

1 Answers1

73

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. It's not a resource of your project, but a compile dependency. I would put it in a lib directory.

Jayan
  • 18,003
  • 15
  • 89
  • 143
JB Nizet
  • 678,734
  • 91
  • 1,224
  • 1,255
  • How can I add a jar of source to get the documentation in my IDE. – dirtydexter Aug 04 '15 at 08:10
  • i added a third party jar using the same syntax mentioned above --> compile files('libs/ojdbc6-11.1.0.jar') . But when war file is built I don't see this jar inside it (WEB-INF\lib) . How do i make sure local jar is present inside the war? – Goutham Nithyananda Mar 15 '18 at 07:46