Perry Trolard <trol...@gmail.com> writes: > Currently for the Leiningen uberjar task, all dev-dependencies are > included in the resulting standalone jar. In a comment in uberjar.clj, > there's a note that excluding these is on the todo list. I wonder if > there are any ideas on how best to do it?
One simple way would be to simply invoke clean and deps before running the main uberjar code, but that's wasteful. > I tried to tackle this in a naive way — finding jar files based on the > project name — but this doesn't catch dependecies futher down the > chain, e.g. for lein-clojars this'll find the lein-clojars.jar but > won't find jsch.jar, its dependency. More maven-aware folks may have > better ideas, but how does this solution sound: segregating dev- > dependencies in the <project>/lib/dev directory upon download? For > lein tasks that construct the project classpath, lib/dev would then be > included in it; for the uberjar task, only jars in the lib directory > would be zipped up. I'm a little reluctant to make calculating the classpath any more complicated than it currently is since that logic needs to be duplicated in a few places, but I agree that the current situation is not great. Another idea would be to write a hidden blacklist file when fetching the dev dependencies. The uberjar could then check that to know which jars to skip. I'm not sure which approach I prefer... thoughts? > I was working on uberjar because I want to write a similar task as a > plugin, which is an uberjar without clojure & clojure-contrib > included, so that I can drop a project & its dependencies in my local > Clojure development environment, e.g. my Clojure saxon wrapper library > as well as the Java Saxon jars it depends on. Anyone else have this > use case? I'm not sure I understand. Why don't you just open your saxon wrapper project in your IDE directly rather than adding an uberjar generated from it? Plus if you put clojure and contrib on the classpath before your uberjar, then the versions in your uberjar will be shadowed. -Phil -- 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