Skip to content

Instantly share code, notes, and snippets.

@kennyjwilli
Created June 22, 2018 23:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kennyjwilli/3c0371bc129628c523bf5b74ab316577 to your computer and use it in GitHub Desktop.
Save kennyjwilli/3c0371bc129628c523bf5b74ab316577 to your computer and use it in GitHub Desktop.
Maven to deps.edn converter
(defn transform-deps
[deps]
(binding [*print-namespace-maps* false]
(clojure.pprint/pprint
(reduce (fn [deps-edn [id version & opts]]
(let [opts (apply hash-map opts)]
(if (= "test" (:scope opts))
deps-edn
(assoc deps-edn
id (merge {:mvn/version version}
(select-keys opts [:exclusions :classifier :extension]))))))
(sorted-map) deps))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment