I'm using 'lein uberjar' to make a executable jar file of my project. the jar is created correctly and runs as expected.
I just want to know if it is possible to NOT include my source .clj files in the generated .jar, since I'm planning to distribute it, and I don't want my source files available to the public.
I'm using lein 1.7.1
if not possible with lein, would it work if I just manually removed the .clj files from the jar? I did a test and it worked, by I want to be sure that this is safe to do.
thanks in advance.
Use :omit-source true
in lein's project.clj
.
Have you tried using the aot compilation step that is provided? See here for an example.
Also, someone blogged something not too long ago about aot compiling their entire project: http://blog.japila.pl/2012/02/aot-compile-all-namespaces-in-a-clojure-project-aot-all-in-project-clj-leiningen/
In that case, too, you might still have to dig in and remove the .clj files, I'm not sure. Maybe this is somewhere to start, though.
I should note that even if you were to use compilation to just distribute the .class files, there are really good tools to decompile those classes in a way that users can read (I've used this in the past when the documentation was so poor I had to look elsewhere to see how it worked).
In those cases, you'd be better off finding a way to implement your own code obfuscator, although I know little/nothing about that topic, here's a start.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With