This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-11-20
Channels
- # babashka (56)
- # beginners (151)
- # calva (3)
- # cider (31)
- # clj-kondo (17)
- # cljs-dev (5)
- # clojure (26)
- # clojure-australia (21)
- # clojure-dev (7)
- # clojure-europe (23)
- # clojure-nl (5)
- # clojure-spec (54)
- # clojure-uk (11)
- # clojuredesign-podcast (8)
- # clojurescript (77)
- # community-development (10)
- # core-typed (1)
- # cursive (3)
- # datomic (7)
- # docker (67)
- # emacs (10)
- # expound (6)
- # figwheel-main (3)
- # graalvm (67)
- # helix (10)
- # java (13)
- # jobs (6)
- # kaocha (4)
- # leiningen (15)
- # malli (2)
- # meander (31)
- # off-topic (40)
- # pedestal (9)
- # rdf (7)
- # reagent (5)
- # reitit (9)
- # remote-jobs (5)
- # shadow-cljs (94)
- # sql (7)
- # testing (12)
- # tools-deps (75)
- # vim (13)
One of the dependencies in my leiningen project has a resource packaged into the jar file at public/css/site.css
. How do I get my project to copy this file into a specific folder when building (like from an alias)?
@regen I don’t think there is a direct way statically - there is lein-jar-copier
out there - but it’s old and also too specific to jars - we actually internally made a lein-artifact-copier
(internal to my company) that generalizes to this sort of isseu - but not released as public as of now.
however, if the jar has public/css/site.css
inside it - then that should be on your classpath when you have that dependency
Thanks for the response! It's not too late; I'll try it out now. I'm pretty unfamiliar with Java so really scratching my head over this.
I'm trying to write a function in project.clj
to read this file from the classpath and write it where I want it, then hope to be able to call that function from a lein alias. If I just add (println (
to the top of my project.clj, it will print nil (slurping will throw an error) when I run the project.
Just so you know, public/css/site.css
is the location of the file when I unzip the jar file of the dependency in .m2
. I don't know if I need to add some kind of prefix to reference it from the other project.
Alright, I followed https://github.com/technomancy/leiningen/blob/stable/doc/PLUGINS.md#not-writing-a-plugin-%E6%97%A0%E4%B8%BA to call a function in my project namespace that does the io/resource
and copies the file to where I want it. Last problem is there's a file in the project that happens to have the same exact path and name, and it seems that file overwrites the one from the dependency. I'm probably just going to rename the file, but is there a way around this?
@regen when the project tasks are being ran - you likely wont’ have any dependenices on the classpath