Fork me on GitHub
#leiningen
<
2023-09-19
>
damirb07:09:04

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

hifumi12302:09:40

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

hifumi12302:09:37

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")

damirb04:09:49

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