# Combining tools.deps with Leiningen

**URL:** https://clojureverse.org/t/combining-tools-deps-with-leiningen/658
**Category:** General Questions
**Created:** [November 7, 2017, 2:23pm UTC](https://clojureverse.org/t/combining-tools-deps-with-leiningen/658 "2017-11-07T14:23:52Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![plexus](https://clojureverse.org/user_avatar/clojureverse.org/plexus/32/6_2.png) [@plexus](https://clojureverse.org/u/plexus)
#### Post date: [November 7, 2017, 2:23pm UTC](https://clojureverse.org/t/combining-tools-deps-with-leiningen/658/1 "2017-11-07T14:23:53Z")

</div>

I’m really liking the way [tools.deps.alpha](https://github.com/clojure/tools.deps.alpha) is shaping up. I’ve wanted something like this since forever: a tool that manages dependencies and the classpath, and nothing more, the way that e.g. Ruby has bundler.

But you’ll still need some kind of task runner for automating things like building jars, running tests, etc.

This could perhaps still be leiningen, but then leiningen would need to be tools.deps-aware, maybe something like

```auto
(defproject foo
  :dependencies :tools.deps
  ,,,)

```

Do you think we’ll get something like this, or are boot/lein just going to continue doing their own thing? I wonder how hard it would be to implement this.

Or maybe we’ll start seeing a new tool that fills this gap.

---

<div class="post-metadata">

### Author: ![martinklepsch](https://clojureverse.org/user_avatar/clojureverse.org/martinklepsch/32/80_2.png) [@martinklepsch](https://clojureverse.org/u/martinklepsch)
#### Post date: [November 7, 2017, 3:02pm UTC](https://clojureverse.org/t/combining-tools-deps-with-leiningen/658/2 "2017-11-07T15:02:29Z")

</div>

I think this would be a fantastic way forward especially with regards to interoperability between Boot and Leiningen. Also it should make static analysis of dependencies much much easier for tools like Cursive.

I’ve seen Sean Corfield mention that he wants to work on something like this for Boot but I don’t think there’s any code yet.

---

<div class="post-metadata">

### Author: ![seancorfield](https://clojureverse.org/user_avatar/clojureverse.org/seancorfield/32/195_2.png) [@seancorfield](https://clojureverse.org/u/seancorfield)
#### Post date: [November 7, 2017, 4:54pm UTC](https://clojureverse.org/t/combining-tools-deps-with-leiningen/658/3 "2017-11-07T16:54:44Z")

</div>

Yup. We already have all our dependencies in external EDN files st work and I’d like to switch them over to the tools.deps format so I’ll be writing this code at some point.

---

<div class="post-metadata">

### Author: ![plexus](https://clojureverse.org/user_avatar/clojureverse.org/plexus/32/6_2.png) [@plexus](https://clojureverse.org/u/plexus)
#### Post date: [November 9, 2017, 9:10am UTC](https://clojureverse.org/t/combining-tools-deps-with-leiningen/658/4 "2017-11-09T09:10:36Z")

</div>

Nice! We’re currently doing something like this for Leiningen

```auto
;; project.clj
(require '[clojure.edn :as edn])

(def +deps+ (-> "deps.edn" slurp edn/read-string))

(defn deps->vec [deps]
  (vec (map (fn [[dep {:keys [:mvn/version exclusions]}]]
              (cond-> [dep version]
                exclusions (conj :exclusions exclusions)))
            deps)))

(def dependencies
  (deps->vec (:deps +deps+)))

(def dev-dependencies
  (deps->vec (get-in +deps+ [:aliases :dev :extra-deps])))

(def source-paths
  (vec (:paths +deps+)))

(defproject my-project "1.0.0"
  :dependencies ~dependencies
  :source-paths ~source-paths
  :profiles
  {:dev
   {:dependencies ~dev-dependencies}})

```

---

<div class="post-metadata">

### Author: ![seancorfield](https://clojureverse.org/user_avatar/clojureverse.org/seancorfield/32/195_2.png) [@seancorfield](https://clojureverse.org/u/seancorfield)
#### Post date: [November 10, 2017, 6:26am UTC](https://clojureverse.org/t/combining-tools-deps-with-leiningen/658/5 "2017-11-10T06:26:07Z")

</div>

That doesn’t handle any of the cascading from system deps to user deps to project deps tho’ – I would want to take that into account. I’ll probably look at it this weekend, since my partner’s away (judging a cat show in Shanghai!) and I’ll be bored 🙂

---

<div class="post-metadata">

### Author: ![martinklepsch](https://clojureverse.org/user_avatar/clojureverse.org/martinklepsch/32/80_2.png) [@martinklepsch](https://clojureverse.org/u/martinklepsch)
#### Post date: [November 10, 2017, 5:33pm UTC](https://clojureverse.org/t/combining-tools-deps-with-leiningen/658/6 "2017-11-10T17:33:45Z")

</div>

> [@seancorfield](#):
>
> judging a cat show in Shanghai!

#lifegoals 😂 (sorry for the noise, had to)

---

<div class="post-metadata">

### Author: ![seancorfield](https://clojureverse.org/user_avatar/clojureverse.org/seancorfield/32/195_2.png) [@seancorfield](https://clojureverse.org/u/seancorfield)
#### Post date: [November 12, 2017, 6:56pm UTC](https://clojureverse.org/t/combining-tools-deps-with-leiningen/658/7 "2017-11-12T18:56:59Z")

</div>

So far my weekend boredom has been consumed with enhancing how Marginalia deals with inline comments but after lunch I think I’ll tackle `tools.deps` 🙂

---

<div class="post-metadata">

### Author: ![martinklepsch](https://clojureverse.org/user_avatar/clojureverse.org/martinklepsch/32/80_2.png) [@martinklepsch](https://clojureverse.org/u/martinklepsch)
#### Post date: [November 14, 2017, 7:00am UTC](https://clojureverse.org/t/combining-tools-deps-with-leiningen/658/8 "2017-11-14T07:00:46Z")

</div>

I saw @seancorfield posting this in the Boot slack: [https://github.com/seancorfield/boot-tools-deps](https://github.com/seancorfield/boot-tools-deps)

---

<div class="post-metadata">

### Author: ![marco-m](https://clojureverse.org/user_avatar/clojureverse.org/marco-m/32/858_2.png) [@marco-m](https://clojureverse.org/u/marco-m)
#### Post date: [January 11, 2018, 7:22am UTC](https://clojureverse.org/t/combining-tools-deps-with-leiningen/658/9 "2018-01-11T07:22:49Z")

</div>

This is brewing for Leiningen: “A leiningen plugin that lets you share tools.deps.alpha dependencies in your leiningen project”

> **[GitHub - RickMoynihan/lein-tools-deps: A leiningen plugin that lets you share...](https://github.com/RickMoynihan/lein-tools-deps)**
>
> A leiningen plugin that lets you share tools.deps.alpha dependencies in your leiningen project - GitHub - RickMoynihan/lein-tools-deps: A leiningen plugin that lets you share tools.deps.alpha depen...

---

<div class="post-metadata">

### Author: ![system](https://clojureverse.org/uploads/default/original/2X/5/51079bf9e4b7d9466242c06cf1e43b9f8bd6da14.png) [@system](https://clojureverse.org/u/system)
#### Post date: [October 5, 2018, 12:50pm UTC](https://clojureverse.org/t/combining-tools-deps-with-leiningen/658/10 "2018-10-05T12:50:47Z")

</div>


