leiningen

manas_marthi 2021-08-10T12:47:29.013600Z

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

manas_marthi 2021-08-10T12:49:03.015400Z

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

manas_marthi 2021-08-10T12:49:14.015800Z

in project.clj

manas_marthi 2021-08-10T12:49:58.016400Z

and pluginRepositeries as well...

manas_marthi 2021-08-10T12:50:00.016600Z

Thanks

edo 2021-08-10T14:04:50.018100Z

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 (ClassLoader.java:-2).
       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?

edo 2021-08-10T14:18:35.020400Z

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

java.runtime.version=11
This way heroku we’ll use JDK 11. 🚀

2021-08-10T21:22:13.021200Z

@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

2021-08-21T04:18:32.046500Z

I don’t see a class file in above

rkiouak 2021-08-10T21:25:18.021400Z

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

rkiouak 2021-08-14T17:57:17.045500Z

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?

rkiouak 2021-08-14T17:57:28.045700Z

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

2021-08-11T17:14:24.022400Z

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.

2021-08-11T17:14:31.022800Z

What you showed above was classfiles

2021-08-11T17:14:41.023300Z

Those are only there if you are AOT compiling clj

2021-08-11T17:15:06.024100Z

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

2021-08-11T17:15:46.025500Z

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

rkiouak 2021-08-11T17:21:06.025700Z

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.

rkiouak 2021-08-11T21:02:14.026200Z

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!

👍 1
2021-08-11T21:04:05.026900Z

Yes indeed. A bit of a complicated topic

2021-08-11T21:04:57.027500Z

Glad this info helped out some

rkiouak 2021-08-21T11:59:56.046700Z

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