I personally dislike both of these suggestions (flatdir or FileCollection) and instead prefer a local repository using the maven style directory layout.
Eg:
repositories {
maven {
url file('/path/to/local/maven/repo')
}
}
Using a maven style layout you can still support:
- proper dependency resolution
- transitive dependencies by including a pom
- source & javadoc artifacts (useful in your IDE)
- seamless switch to a remote repository in future
See this related post