Dependency report for file dependency


(Benjamin Muschko) #1

I have a simple build script that defines a single file dependency (in this case Apache Commons Lang) without a repository. It basically just sits in the subdirectory lib. This is how the build script looks like:

configurations {
 mydep
}
  dependencies {
 mydep files('lib/commons-lang3-3.1.jar')
}

When I run the task gradle dependencies I would expect to see it displayed in the dependency report but it doesn’t show up.

$ gradle -q dependencies
  ------------------------------------------------------------
Root project
------------------------------------------------------------
  mydep
No dependencies

Is there a specific reason to why a file dependency is not listed e.g. a required repository definition? As a side-note this works fine when declaring the lib subdirectory as flat directory repository, as shown in the following script:

configurations {
 mydep
}
  dependencies {
 mydep ':commons-lang3:3.1@jar'
}
  repositories {
 flatDir {
   dirs 'lib'
  }
}

The output looks as follows:

$ gradle -q dependencies
  ------------------------------------------------------------
Root project
------------------------------------------------------------
  mydep
\--- :commons-lang3:3.1

This behavior was created with Gradle 1.2.


(Szczepan Faber) #2

Hey Benjamin!

The dependencies report doesn’t include file dependencies. We do want to fix that, and find a place for them in the dependency report. I’m pretty sure we have already a ticket for it in jira.


(Benjamin Muschko) #3

Great, thanks! For reference GRADLE-1332 addresses the issue.