Fork me on GitHub

Im trying to migrate a project from uberdeps/uberdeps to and was wondering how to deal with resources, like .edn files when building an uber-jar. My build.clj file contains something like this:

(def basis (b/create-basis {:project "deps.edn"
                            :aliases [:shared
(def class-dir "target/classes")

(defn uber [_]

  ;(b/copy-dir {:src-dirs   [ ... resource-dirs-from-aliases ...]
  ;             :target-dir class-dir})

  (b/compile-clj {:basis     basis
                  :class-dir class-dir})

  (b/uber {:class-dir class-dir
           :uber-file "target/service.jar"
           :basis     basis
           :main      'service.main}))
but without the copy-dir explicitly listing the resource dirs that are declared as :extra-src in the aliases, they will not be part of jar file. I can collect these dirs from the basis but maybe there is a more straightforward way or am I missing something here?


my current solution is:

(b/copy-dir {:src-dirs   (->> basis
                                (filter #(clojure.string/ends-with? % "/resources")))
               :target-dir class-dir})

Alex Miller (Clojure team)12:08:22

Typically you want your resource dirs in your :paths (as they are part of the classpath), and then you will get them from the copy-dir


the resource dirs are in :extra-paths of each alias but the *.edn files in there will not be part of the uberjar

{:aliases {:component_a {:extra-paths ["src/component_a/clj" "src/component_a/resources"]}


or is :extra-paths vs. :paths the problem?