Question: does anyone know if it’s possible to exclude a single file from a dependency? i have a situation where multiple plugin.xml files end up on my classpath, the one that gets placed first isn’t correct :exclusions [foo.bar/baz :extension "xml"] also seemed promising, but doesn’t do what I think it might i.e. i’d want to exclude all plugin.xml files except for the one i specify :uberjar-exclusions seems like the right thing, but as far as i can tell you can only operate on the file path, not the source path

Asked By
jstokes
Asked At
2017-08-01 21:16:18

Found 15 possible answers.

User Answered At Possible Answer
pseud 2017-08-02 07:11:12 @bfabry I don't know if things changed or it was a complete brain-fart, but I managed to work it out sometime after in the same manner as you described, so thanks :slightly_smiling_face:
d5p 2017-08-02 10:02:08 i’ve got a strange issue where on a certain host it appears lein uberjar is executing some code as part of compile that is not happening in any other environments , causing a failure other than ~/.lein/profiles.clj is there anything else that could alter its compile behaviour?
danielcompton 2017-08-02 10:37:18 @bfabry :dev-dependencies was a lein 1 era key https://github.com/technomancy/leiningen/blob/ad6c4bd290d6d59b20e781659d0dd19ca8d50c92/NEWS.md#200-preview1--2012-03-07 @d5p there are LEIN_* environment variables that can affect which Java compiler is used and other Lein behaviour. There's also your standard Java env vars. You may also have stale JARs in your .m2?
d5p 2017-08-02 10:49:31 no env vars set (other than JAVA_HOME) , have nuked .m2 and let it re-download well weirdly both issues which don’t happen on most machines but just on a select few are resolved by using lein-aot-order to explicitly order my namespaces for compilation wow things really not going my way today , fresh docker clojure image , fresh checkout of source , lein uberjar fails to compile with a basic Caused by: java.lang.ClassNotFoundException: vacer.util from one ns requiring that and for some reason compiler not following that? totally bizarre still only on this specific machine it fails , trying to actually execute something where it doesn’t on other hosts
xiongtx 2017-08-03 00:25:06 Do Lein test selectors have access to other test selectors? Or only to test metadata? Seems like it’d be more composable if test selectors can refer to each otehr.
                 ...}
                                   (not (:integration %)))
                 :app-2-unit #(and (:app-2 %)
                 :app-1 :app-1
                                          (:integration %))
                 :app-1-integration #(and (:app-1 %)
                                   (not (:integration %)))
:test-selectors {:app-1-unit #(and (:app-1 %) The following seems a bit repetitive: I happen to several different classes of tests (e.g. ^:app-1 and ^:app-2 ), as well as a differentiation between types of tests ( ^:integration vs. not).
kumarshantanu 2017-08-03 05:28:30 Hi, can anybody share a tip on how to execute some project initialization code when I run lein test ? I need to load some config and initialize state, but only once for the project, not in every test namespace. Does Leiningen have any hooks for this?
xiongtx 2017-08-03 17:26:58 Environment variables can be set with environ and its Lein plugin, lein-environ : https://github.com/weavejester/environ I also like aero for auto type casting and composing values: https://github.com/juxt/aero You can then have a config.edn file in the project that references those environment variables.
kumarshantanu 2017-08-04 04:42:59 Thanks, but I am actually looking for a way to NOT put the initialization trigger in every test namespace, but rather as a Leiningen hook or something I already have the config/init stuff sorted, I just need to decouple that from every test namespace
p-himik 2017-08-04 12:47:01 How can I extract a map from project.clj to use it two times in the configuration? I extracted the common part into (def main-build {...}) at the top of project.clj and included it simply as :all-builds [~(merge-with merge main-build {...})] , but when I try to run REPL, I get:
Exception in thread "main" java.lang.RuntimeException: Unable to resolve symbol: main-build in this context
Namely, I'm trying to follow https://github.com/binaryage/dirac-sample/blob/master/project.clj#L170-L196 but I don't like the fact that :all-builds there contains the same info as :demo profile, for the most part.
mrchance 2017-08-04 19:47:07 Hi, ist there a known issue that can stop leiningen from working completely? A friend just ran into it, and lein just hangs for him now, even after deleting ~/.lein Happened during dependency download with a completely fresh leiningen install. Last output before its unfortunate and permanent demise was
Retrieving com/yahoo/platform/yui/yuicompressor/2.4.8/yuicompressor-2.4.8.jar from central
kingmob 2017-08-09 19:23:52 If you run lein install to install a local copy of a project, how do you remove it? Is there an uninstall command to have it default back to pulling the project from clojars? Is this not the best forum for Leiningen questions?
bostonaholic 2017-08-09 20:15:19 just delete it from ~/.m2/repository/... I don’t know of an uninstall command manually
kingmob 2017-08-09 21:04:53 Thanks @bostonaholic !
bostonaholic 2017-08-09 21:05:25 np
michaelblume 2017-08-10 23:34:01 also a lot of projects default to having a -SNAPSHOT version in project.clj except for in the commit they release from so that if you build the project from some random commit it won’t obscure a version you would otherwise download

Related Questions