5

For a java/scala project I have some dependencies that are not in a remote repository, but somewhere else in my filesystem. I have then two options, which lead to questions:

  1. I can add a lib/ directory in my project folder. How can I tell buildr to add the content to the class path ?

  2. I can use the builtin dependencies management system. Can I indicate a filesystem repository path instead of an http one ?

Thanks

paradigmatic
  • 40,153
  • 18
  • 88
  • 147

2 Answers2

9

I found the solution I was looking for in buildr mailing list. The compile.with() method accepts an array of file names (with the path prefix of course). So if the dependencies are jars in a directory called lib you can just call:

compile.with Dir['lib/*.jar'] 

in the buildfile. Hope that will help other buildr adepts.

paradigmatic
  • 40,153
  • 18
  • 88
  • 147
  • Couldn't have said it better myself! – Daniel Spiewak Dec 01 '09 at 16:57
  • 1
    'lib/**/*.jar' will get you subfolder of lib as well – s3v1 May 10 '10 at 11:18
  • 1
    Thanks @paradigmatic and @Sebastian! Just what I needed. Has anyone found good "recipes" for buildr? The manual is nice, but I find it short on real examples. Although, to be fair, most things are very simple in buildr so you don't really need a lot of tweaking. – Dave Mar 17 '11 at 17:10
3

Regarding your second question:

I can use the builtin dependencies management system. Can I indicate a filesystem repository path instead of an http one ?

Yes, just like maven2, you can use the file:/// protocol to locate a "remote" repository on the file system.

Antoine Toulme
  • 937
  • 4
  • 15