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

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?

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

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

3 Likes