The best way is to add version numbers to your jar files.
However you can add a second flat dir resolver like so
dependencies {
addFlatDirResolver('serverlib').addArtifactPattern(new
File('../ServerLibraries/lib/').absolutePath+'/[artifact](-[revision]).[ext]')
addFlatDirResolver('serverlib').addArtifactPattern(new
File('../ServerLibraries/lib/').absolutePath+'/[artifact].[ext]')
compile (':commons-httpclient:3.1',':log4j:1.2.15',
':dom4j:1.6.1',':jamon:2.7')
compile ':jets3t:0.6.0'
compile ':spring:unkown'
}
Note that the 'unkown' has no special meaning. It is a version number but the
second flat dir resolver doesn't use the version number
You may also be able to get away with just using one flatDirResovler but having
compile ':spring:'
Matt
----- Original Message ----
From: Jeppe Nejsum Madsen <[email protected]>
To: [email protected]
Sent: Tuesday, 24 March, 2009 13:56:31
Subject: [gradle-user] Local dependencies with no version info?
Hi
I'm trying to replace our aging Ant build system with Gradle. I know one of
Gradle's key features is automatic dependency management, but to ease the
transition, I'm was thinking (unwisely?) to start out by reusing our
existing directory structure if jar files. This works fine for jars with
version info in the filenames, but I can't seem to make it work for jars
without version info. I'm using gradle 0.5.2 btw.
This is my setup
common/
src/
test/
build.gradle
ServerLibraries
lib/
And here's my build.gradle:
version = 1
usePlugin('java')
sourceCompatibility = 1.5
targetCompatibility = 1.5
srcRootName = '.'
srcDirNames = ['src']
testSrcDirNames = ['test']
dependencies {
addFlatDirResolver('serverlib').addArtifactPattern(new
File('../ServerLibraries/lib/').absolutePath+'/[artifact](-[revision]).[ext]
')
compile (':commons-httpclient:3.1',':log4j:1.2.15',
':dom4j:1.6.1',':jamon:2.7')
compile ':jets3t:0.6.0'
compile ':spring:'
}
No matter what I do, the build always fails with the last dependency:
Build file 'D:\workspaces\trunk\common\build.gradle' line: 13
A problem occurred evaluating project :.
Cause: The dependency notation: :spring: is invalid!
Being new to Gradle & Ivy I would appreciate some hints :-)
/Jeppe
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email