How to include jars in the /lib/ directory using dependency section in build.gradle?


(J.V.) #1

We do not yet have an artifact repo setup; I have two jars in a /lib/ directory on the same level as ‘build.gradle’. I am including the following in the build.gradle file:

compile fileTree(dir: ‘lib’, include: ‘*.jar’)

when I compile, (within IntelliJ), it still does not pull in the .jar’s to ‘External Libraries’ and my classes are not recognized; same problem with building from the command line.

Eventually I will have these in an artifact repo, until then, how do I include .jars into my build.gradle file so the code will compile?


(Carlo Luib-Finetti) #2

compile fileTree(dir: ‘lib’, include: ‘*.jar’) should be fine.

If you still have probs, please show your build script.