Hello all, is it a lein template? https://github.com/mdiin/happlate
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?
how are you running the resulting jar?
java -jar <myapp-snapshot-standalone.jar> <my-options>
do you get a stack trace on the project.clj error? I find it very strange that would be required
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 <http://clojure.java.io|clojure.java.io>$fn__11466.invokeStatic(io.clj:229)
at <http://clojure.java.io|clojure.java.io>$fn__11466.invoke(io.clj:229)
at <http://clojure.java.io|clojure.java.io>$fn__11379$G__11372__11386.invoke(io.clj:69)
at <http://clojure.java.io|clojure.java.io>$fn__11478.invokeStatic(io.clj:258)
at <http://clojure.java.io|clojure.java.io>$fn__11478.invoke(io.clj:254)
at <http://clojure.java.io|clojure.java.io>$fn__11379$G__11372__11386.invoke(io.clj:69)
at <http://clojure.java.io|clojure.java.io>$fn__11440.invokeStatic(io.clj:165)
at <http://clojure.java.io|clojure.java.io>$fn__11440.invoke(io.clj:165)
at <http://clojure.java.io|clojure.java.io>$fn__11392$G__11368__11399.invoke(io.clj:69)
at <http://clojure.java.io|clojure.java.io>$reader.invokeStatic(io.clj:102)
at <http://clojure.java.io|clojure.java.io>$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
I am pretty sure none my code requires
project.clj itself
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
you shouldn't be including cider.nrepl in your uberjar
even if you want nrepl, don't use cider in prod
Okay will try removing cider.nrepl and try
Wow, removing cider.nrepl worked, thanks a lot. Any reason why I shouldn’t be including cider.nrepl but can include nrepl?
cider is a development tool, that's why it needs to read your project.clj
it's useless if you aren't using it with the matching code in your editor
(on a team, it's just good etiquette not to force others to use things that are only there for your editor, IMHO)
Cider can be moved to your global dev config, or into a dev profile extending dev in your project
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
haha, I don't mean to be so judgmental, re-reading that
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
can't ship the source, can connect via a remote repl, that's a fascinating combo of requirements
Not at all, you are doing way beyond what is expected by helping so many 🙂
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
haha they must trust you a lot
Haha, not remote repl into theirs if that wasnt obvious