Fork me on GitHub
#leiningen
<
2020-06-30
>
fabrao00:06:13

Hello all, is it a lein template? https://github.com/mdiin/happlate

jacklombard20:06:29

I want to deliver my application without source. I have done an aot all which converts all clj source files to .class files. But it still includes the project.clj which contains sensitive info and I need to exclude it. If I exclude it using uberjar-exclusions, I am not able to run the app and it says it can’t find project.clj. Why is project.clj required for me to execute the jar?

noisesmith20:06:08

how are you running the resulting jar?

jacklombard20:06:59

java -jar <myapp-snapshot-standalone.jar> <my-options>

noisesmith20:06:07

do you get a stack trace on the project.clj error? I find it very strange that would be required

jacklombard20:06:23

Caused by: java.io.FileNotFoundException: project.clj (No such file or directory)
	at java.io.FileInputStream.open0(Native Method)
	at java.io.FileInputStream.open(FileInputStream.java:195)
	at java.io.FileInputStream.<init>(FileInputStream.java:138)
	at $fn__11466.invokeStatic(io.clj:229)
	at $fn__11466.invoke(io.clj:229)
	at $fn__11379$G__11372__11386.invoke(io.clj:69)
	at $fn__11478.invokeStatic(io.clj:258)
	at $fn__11478.invoke(io.clj:254)
	at $fn__11379$G__11372__11386.invoke(io.clj:69)
	at $fn__11440.invokeStatic(io.clj:165)
	at $fn__11440.invoke(io.clj:165)
	at $fn__11392$G__11368__11399.invoke(io.clj:69)
	at $reader.invokeStatic(io.clj:102)
	at $reader.doInvoke(io.clj:86)
	at clojure.lang.RestFn.invoke(RestFn.java:410)
	at clojure.lang.AFn.applyToHelper(AFn.java:154)
	at clojure.lang.RestFn.applyTo(RestFn.java:132)
	at clojure.core$apply.invokeStatic(core.clj:667)
	at clojure.core$slurp.invokeStatic(core.clj:6942)
	at clojure.core$slurp.doInvoke(core.clj:6942)
	at clojure.lang.RestFn.invoke(RestFn.java:410)
	at cider.nrepl.version__init.load(Unknown Source)
	at cider.nrepl.version__init.<clinit>(Unknown Source)
	... 70 more

jacklombard20:06:58

I am pretty sure none my code requires project.clj itself

jacklombard20:06:02

If I am in a folder that contains the required project.clj and run the jar from that directory it works, but that dissolves the whole point of having an independent jar

noisesmith20:06:55

you shouldn't be including cider.nrepl in your uberjar

noisesmith20:06:06

even if you want nrepl, don't use cider in prod

jacklombard21:06:35

Okay will try removing cider.nrepl and try

jacklombard21:06:34

Wow, removing cider.nrepl worked, thanks a lot. Any reason why I shouldn’t be including cider.nrepl but can include nrepl?

noisesmith21:06:14

cider is a development tool, that's why it needs to read your project.clj

noisesmith21:06:42

it's useless if you aren't using it with the matching code in your editor

noisesmith21:06:29

(on a team, it's just good etiquette not to force others to use things that are only there for your editor, IMHO)

noisesmith21:06:54

Cider can be moved to your global dev config, or into a dev profile extending dev in your project

jacklombard21:06:32

Okay, this is code I inherited and almost all the devs here use emacs I guess and the cider.nrepl middlewares were there for years. Yes but point is very much noted and we will plan on removing cider.nrepl from all our apps in prod

noisesmith21:06:34

haha, I don't mean to be so judgmental, re-reading that

jacklombard21:06:53

Not at all, you are doing way beyond what is expected by helping so many 🙂

jacklombard21:06:09

This probably also explains why when some of us tried to connect to a staging repl using cursive it didnt work, I know now that this because of cider middlewares

💯 3
noisesmith21:06:50

can't ship the source, can connect via a remote repl, that's a fascinating combo of requirements

jacklombard21:06:34

yup, we’ll be giving jars to a business partner whom we don’t want to share the source with, at the same time we want to be able to use the same new workflow of aot compilation but be able to remote repl

noisesmith21:06:03

haha they must trust you a lot

jacklombard21:06:57

Haha, not remote repl into theirs if that wasnt obvious