I'm using Gradle and I gave the following dependencies:
dependencies {
compile 'org.slf4j:slf4j-api:1.7.13'
compile 'org.mongodb:mongodb-driver:3.2.2'
testCompile 'org.testng:testng:6.8.1'
testCompile 'junit:junit:3.8.2'
}
I want to download the driver of MongoDB. I typed:
gradle build
and after a few seconds I got a message saying the the build had succeeded. Now, I'm looking for the jar file/directory of MongoDB driver, and I don't find it. Where is it supposed to be?
Gradle declares dependencies on JAR files inside your project's module_name /libs/ directory (because Gradle reads paths relative to the build.gradle file). This declares a dependency on version 12.3 of the "app-magic" library, inside the "com.example.android" namespace group.
In your file manager there is a Folder named Android. That folder has all the libraries of all the Apps. Some data are not visible to normal user so you have to root your phone to be able to view all the files in Android Folder.
The Jar is created under the $project/build/libs/ folder.
Defining your dependency Now that Gradle knows which repository to look in, let's tell it what to look for. We do that within the dependencies section of the build script. Specify the co-ordinates, or in other words the group, artifactId, and version, within a string using a colon separator.
~/.gradle/caches/modules-2/files-2.1/org.mongodb/mongodb-driver/3.2.2/<checksum of the JAR>/mongodb-driver-3.2.2.jar
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With