Fork me on GitHub

I'm trying to write a plugin that uses lucene, but it seems that leiningen already includes a version of lucene. How do I avoid these dependency conflicts in a plugin and use my intended version?


@vipaca not sure if you can, Leiningen is distributed as an uberjar, and I don’t think you can put stuff ahead of it on the classpath (and that might be a bad idea)


Looks like does this by using leiningen.core.eval/eval-in-project except not in the invoking project, but rather a project of its own with cloc as the only dependency.


In that way its grabs invoking project's details then isolates from that project and leiningen via separate subprocess.


Oh forgot Lucene is Java. You could use Maven Shade to do the same thing there


Or maybe mranderson supports Java too, not sure


I was thinking that mranderson would be good for what ends up doing which is very simliar.


Its has a tool to move/inline deps to avoid collision with leiningen deps.


is there any way to specify where or how extra files are to be added to a jar? :filespecs is close to what i want but it's off in that if i say {:type :paths ["foo/" "bar/"]} instead of adding foo/ and bar/ it adds the contents of foo/ and bar/ to the root of the jar. what i want is to say put foo/ and bar/ at the root of the jar.


@noprompt: I would add a lein alias command for packaging jar and there I would do a bash script which would copy contents in the way and shape as needed and then call jar task operating on that dir as :source-paths or something along those lines


usually I use lein-shell to add shell command to my project.clj


also somewhat related hint: to override/wrap “standard” lein task, with a shell script which then calls back to perform standard implementation, I use this trick in profiles: then I can freely override for example “jar” task with my own alias, and call back original via lein with-profile +nuke-aliases jar ugly, but does the job


@darwin: haha, i was hoping it wouldn't come to that. simple_smile


that being said, i'm thinking i might just go that route since it's looking dire elsewhere.


@darwin: i actually ended up going with the maven assembly plugin and doing lein pom && mvn install.