2011-11-03

Gradle flatDir repository

Q:
"
For a Gradle flatDir repository, is it looking for a local filesystem that is built up like Maven (pom's etc)..
or is it just looking for jar files in a folder called lib?
"

repositories {
flatDir name: 'localRepository', dirs: 'lib'
}


A:
"
As you assume it just looks for jars/wars/whatever in the 'lib' folder. It resolves versions by looking at the version number in the filename. for instance:
myveryownjar-1.2.0.jar
spring-2.5.6.jar
"

"
Pretty much. For each dependency that you declare in the build script, Gradle will look for a corresponding file in the 'lib' directory. For example, for a dependency on 'junit:junit:4.7', Gradle would look for
lib/junit-4.7.jar or lib/junit.jar. It assumes there are no transitive dependencies.
"

Adapted from http://gradle.1045684.n5.nabble.com/Flat-Dir-repositories-td1431519.html

No comments: