Gradle local dependencies not visible

In my project, I use some local dependencies:

dependencies { compile files('lib/mylib.jar') } 

Why, when I call gradle dependencies , I do not see this library as a dependency? The gradle dependencies --configuration compile command returns this:

 :dependencies ------------------------------------------------------------ Root project ------------------------------------------------------------ compile - Compile classpath for source set 'main'. No dependencies 

Dependencies downloaded from the repository (maven / ivy) are visible. For instance:

 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 displayed, but the project compiles correctly.

+6
source share
1 answer

Gradle documentation file dependency explains

File dependencies are not included in the published dependency descriptor for your project. However, file dependencies are included in the transitive project dependencies within the same assembly. This means that they cannot be used outside the current assembly, but they can be used with the same assembly.

+4
source

Source: https://habr.com/ru/post/948297/


All Articles