Chocochat
(Chocochat)
April 3, 2020, 10:40pm
1
HI, How to download an internal jar and place it in the build directory in build.gradle.kts
this is how I did in build.gradle
configurations {
customjar
}
dependencies {
customjar(“com.test.agent:test-agent:1.0”)
}
task copyAgent(type: Copy) {
from { configurations.customjar } into "$buildDir/libs"
}
build.dependsOn copyAgent
shadowface
(mohamed aouled issa)
April 4, 2020, 2:55pm
2
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.