On Jul 4, 2011, at 7:52 AM, Michael Wood wrote:

> "Repository" need not imply anything to do with networking.  I'm sure
> someone will correct me if I'm wrong, but I am pretty sure that the
> repository Steve [Lindsay] is talking about above is just a hierarchy of files
> in your home directory.

Right, there's a per-user repository at ~/.m2/repository .

Without any change to lein, its "install" subcommand will place a jar for the 
current project within ~/.m2/repository . The jar can be used from there in 
other local projects. Here's an example:

  % cd <project-A-dir>
  % lein install
  [...]
  [INFO] Installing ./projectA-1.0.0-SNAPSHOT.jar to 
~/.m2/repository/projectA/projectA/1.0.0-SNAPSHOT/projectA-1.0.0-SNAPSHOT.jar
  % cd <project-B-dir>
  % lein install
  [...]
  [INFO] Installing ./projectB-1.0.0-SNAPSHOT.jar to 
~/.m2/repository/projectB/projectB/1.0.0-SNAPSHOT/projectB-1.0.0-SNAPSHOT.jar
  % cd <project-C-dir>
  % cat project.clj
  defproject projectC "1.0.0-SNAPSHOT"
    :description "FIXME: write description"
    :dependencies [[org.clojure/clojure "1.2.1"]
                   [projectA "1.0.0-SNAPSHOT"]
                   [projectB "1.0.0-SNAPSHOT"]])
  % lein deps
  Copying 3 files to <project-C-dir>/lib
  % ls lib                                                               
  clojure-1.2.1.jar               projectB-1.0.0-SNAPSHOT.jar
  projectA-1.0.0-SNAPSHOT.jar

This appears to meet Konrad's original specs except (depending on the intended 
meaning of "repository") for:

> 4) Must handle dependencies in the form of on-disk jar files (not in any 
> repository)

I would argue that the ~/.m2 repository is nearly as easy to work with as any 
other local, on-disk scheme one might envision and has the benefit of working 
with any maven-compatible tool.

It also works for arbitrary jars one may have on disk (acquired from any 
source) via:

  http://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html

--Steve

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to