In my project I use some local dependencies:
dependencies {
compile files('lib/mylib.jar')
}
Why when I call gradle dependencies
I can't see this library as a dependency? Command gradle dependencies --configuration compile
returns this:
:dependencies
------------------------------------------------------------
Root project
------------------------------------------------------------
compile - Compile classpath for source set 'main'.
No dependencies
Dependencies downloaded from repository (maven/ivy) are visible. For example:
repositories {
mavenCentral()
}
dependencies {
compile 'com.google.guava:guava:14.0.1'
}
will show:
:dependencies
------------------------------------------------------------
Root project
------------------------------------------------------------
compile - Compile classpath for source set 'main'.
\--- com.google.guava:guava:14.0.1
BUILD SUCCESSFUL
I should also add that dependencies are not shown but project compiles properly.
Gradle uses $USER_HOME/. gradle as the default directory to store its local cache.
To add a dependency to your project, specify a dependency configuration such as implementation in the dependencies block of your module's build. gradle file. This declares a dependency on an Android library module named "mylibrary" (this name must match the library name defined with an include: in your settings.
Given a required dependency, with a version, Gradle attempts to resolve the dependency by searching for the module the dependency points at. Each repository is inspected in order. Depending on the type of repository, Gradle looks for metadata files describing the module ( .
Gradle documentation on file dependency explains
File dependencies are not included in the published dependency descriptor for your project. However, file dependencies are included in transitive project dependencies within the same build. This means they cannot be used outside the current build, but they can be used with the same build.
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