Fork me on GitHub


lein uberjar
as part of our Azure Dev Ops CI/CD pipeline has been taking forever. It sometimes times out after 60 mins. If it does complete it takes at least 20. I'm not really sure how to even begin to diagnose (I'm new leiningen and Java in general). Running locally works fine. I did find that adding these jvm options to the project.clj file sped things up on my laptop. But they seem to have the opposite affect on our CI/CD pipeline.
:jvm-opts ["-Xms2g" "-Xmx2g" "-XX:-UseCompressedOops"]
the rest of our uberjar options look like:
{:uberjar {:omit-source true
             :aot :all
             :uberjar-name "<my-projects-name>.jar"
             :source-paths ["env/prod/clj"]
             :resource-paths ["env/prod/resources"]
             :jvm-opts ["-Xms2g" "-Xmx2g" "-XX:-UseCompressedOops"]}
(except we don't use those jvm-opts in the CI/CD pipeline) Could :aot :all be slowing things down? Does anyone have any thoughts or suggestions for how to further investigate? Thanks!

Alex Miller (Clojure team)21:05:32

if you set env var DEBUG to anything, lein will give you more output


@wyeager the most common culprit of jar building taking forever is a side effect inside a def form that creates a thread or activates a resource


or blocks forever and never activates the resource effectively....


you can use a signal (also generated by Control-\ in a local terminal) to see what all your threads are trying to do, that's often enlightening in a stalled build


$ kill -3 PID for the PID of the java process doing the uberjar


thanks guys! I'll give your suggestions a try!