leiningen

ericdallo 2021-10-16T23:17:43.054400Z

Hello, I'm having issues making my plugin (`lein-clojure-lsp`) set a JVM opt, does anyone knows how to properly configure it? 🧵

vemv 2021-10-21T23:03:26.003Z

Yes, instead of doing it in project.clj, do it in the plugin ns its 'main' function receives a project map as data representing the end user's project, you can add the jvm opt there

ericdallo 2021-10-21T23:08:29.003300Z

Oh, nice, I will try that, thank you @vemv!

ericdallo 2021-10-21T23:08:58.003500Z

I just need to assoc JVM options including mine merging with the existing if any right

vemv 2021-10-21T23:10:06.003700Z

guess so :)

ericdallo 2021-10-16T23:18:36.054500Z

I want to make my plugin set "--add-opens" "java.base/java.nio=ALL-UNNAMED" , I already tried adding :jvm-opts ["--add-opens" "java.base/java.nio=ALL-UNNAMED"] to the plugin project.clj

ericdallo 2021-10-16T23:19:02.054700Z

also, I tried adding that jvm opts to the project that is using the plugin as well and it didn't work

ericdallo 2021-10-16T23:19:32.054900Z

the only way I got that to work is via the env var:

LEIN_JVM_OPTS="--add-opens=java.base/java.nio=ALL-UNNAMED" lein clojure-lsp clean-ns --dry 

ericdallo 2021-10-16T23:20:13.055100Z

but that's not what I want since I want to add that jvm flag for all users of lein-clojure-lsp to avoid warnings like:

WARNING: Illegal reflective access by org.lmdbjava.ByteBufferProxy$AbstractByteBufferProxy (file:/home/greg/.m2/repository/com/github/clojure-lsp/clojure-lsp/2021.09.30-15.28.01/clojure-lsp-
2021.09.30-15.28.01.jar) to field java.nio.Buffer.address                                                                                                                                     
WARNING: Please consider reporting this to the maintainers of org.lmdbjava.ByteBufferProxy$AbstractByteBufferProxy                                                                            
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations                                                                                         
WARNING: All illegal access operations will be denied in a future release

ericdallo 2021-10-16T23:20:18.055300Z

any suggestions?