Fork me on GitHub

Hi All, need a help.. can lein use my .m2/settings.xml?


If not how to specify corporate proxy info, maven <server> info, mirrors,<repositories>


in project.clj


and pluginRepositeries as well...


Hi everyone 👋 , not sure this is the right place to post this question. I’m a beginner and I’m struggling to deploy my lein api project to heroku. I’m getting this error on heroku, while deplyoing, which I can’t overcome. I’m using openJDK 1.8.2 in my local machine.

Compiling clojures-backend.core
       Syntax error macroexpanding at (trie.cljc:1:1).
       Execution error (UnsupportedClassVersionError) at java.lang.ClassLoader/defineClass1 (
       reitit/Trie has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
Any hints on how to solve this?


oh, I’ve sorted it out. For anyone struggling with this one possible solution is to create a file in the root of your project and specify

This way heroku we’ll use JDK 11. 🚀


@mrkiouak try to use the same profile for deps :tree as for uberjar. if you don’t have anything special defined for that then:

lein with-profile uberjar deps :tree


Note I really ought to have showed the command as lein jar I apologize for that, i failed a context switch check -- everything else applies, but the behavior of unexpected included jars is for lein jar not lein uberjar


lein jar shouldn’t be including any of your dependencies in it at all. That’s what an uberjar does as opposed to normal “slim” jars.


What you showed above was classfiles


Those are only there if you are AOT compiling clj


So the most obvious solution is to be sure you aren’t aot compiling for the jar task


If you must have aot compilation in a jar. Lein should be able to filter it via it’s built in flag there but there could be caveats and I don’t know your setup to know why it wouldn’t already be filtering the non project classfiles


That's interesting. I'd "worked around" this by moving the nses that needed aot to another library, which eliminated the other dependencies appearing as aoted in the jar file, presumably because the separate jar has a much, much smaller set of dependencies that may not get filtered. I think we do need the aot of two nses because of gen-class created classes intended for interop with a native java servlet, but I can double check that.


Thanks, that appears to be an exact explanation (in the jira item) for the behavior I was seeing, and when I get a chance to try that flag I suspect it will remove the issue without a dependency move as well. Thanks for looking at this, and pointing out the history and how this isn't a strange leiningen default, but due to decisions made by the clojure aot compiler!

👍 2

Yes indeed. A bit of a complicated topic


Glad this info helped out some


I’m still seeing a:

% ls
META-INF	clojure		protojure
shouldn’t I expect clojure/* class files to be deleted as its an artifact from project dependencies?


(where that ls is in an unzip of the generated jar)


I don’t see a class file in above


I suppose I ought to have done a find .., just assumed the directory structure had classes under them. Thanks…