leiningen

damirb 2023-09-19T07:24:04.617939Z

I have a problem refactoring lein project.clj. I use 10-15 profiles, for building uberjar I combine some profiles and try to build it. It fails with:

Error: Could not find or load main class clojure.main
Caused by: java.lang.ClassNotFoundException: clojure.main
Compilation failed: Subprocess failed (exit code: 1)
Error encountered performing task 'jar' with profile(s): 'clj-build,clj-uberjar-main,cljc-common,clj-common,cljc-main,clj-main'
Compilation failed: Subprocess failed (exit code: 1)
• it fails on building jar step • it looks like it cant find clojure (which is there, in deps) • when i pprint profile with lein-pprint, and try to run that project.clj it works (I add defproject..) lein 2.10

damirb 2023-09-22T04:45:49.685179Z

yeah, that was what I thought, but with pprint clojure is clearly listed as a dependancy in root :dependenices..

hifumi123 2023-09-20T02:51:40.547509Z

do you have a minimally reproducible example? do any of the active profiles declare a clojure dependency, or only the default profile?

hifumi123 2023-09-20T02:52:37.127409Z

without much context, my only (likely wrong) guess is that you've replaced defaults with a collection of profiles, none of which declare clojure as a dependency (or they do but with scope "provided")