Quantcast
Channel: Gradle Forums - Latest posts
Viewing all articles
Browse latest Browse all 19850

Download a third party jar and place it in the build directory

$
0
0

You need to supply the path to that jar file if you’re not using maven.

configurations {
    customjar
}

If you are in an Android setup then

dependencies {
    classpath file('path/to/your/jar/libs/folder')
}

if you are in a java project setup then:

dependencies {
    compile files('path/to/your/jar/file/1', 'path/to/your/jar/file/2'
}

or even better you can specify where to find all your libs jars in one shot like this:

dependencies {
    compile fileTree(dir: '$buildDir/libs', include: '*.jar')
}

I suggest that you don’t place your jars into build directory simply cuz a clean task would remove that folder once executed. instead you can put them under this path $projectDir/libs which would be a simple directory called libs in your root project directory.


Viewing all articles
Browse latest Browse all 19850

Trending Articles