Fork me on GitHub
#depstar
<
2021-07-16
>
genekim16:07:05

Hi, all — I’m trying to get an uberjar created of a Fulcro server application, with AOT to speed up startup time). I can start the server from clj with the given set of aliases no problem.

clj -A:dev:datomic
Clojure 1.10.3
user=> 
But when I attempt to make an uberjar with those same aliases, I get a “file not found” error, even though it should be on the classpath (from the “datomic” alias). Does anyone have any ideas on what I might be doing wrong? Thank you!
clj -X:datomic:dev:uberjar :aot true :jar ./target/feedly-reader-standalone.jar \
		:main-class com.example.components.server
[main] INFO hf.depstar.aot - Compiling com.example.components.server ...
Execution error (FileNotFoundException) at com.example.components.ring-middleware/loading (ring_middleware.clj:1).
Could not locate com/example/components/parser__init.class, com/example/components/parser.clj or com/example/components/parser.cljc on classpath.

Full report at:
/var/folders/wm/3c6kft990tqblqjmdlrhdf640000gn/T/clojure-11232942154003298116.edn

[main] ERROR hf.depstar.aot - Compilation failed!
Execution error (ExceptionInfo) at hf.depstar.uberjar/build-jar-as-exec (uberjar.clj:553).
AOT compilation failed

seancorfield16:07:25

@genekim You don't want those aliases for running depstar, you want them for depstar to use to build the JAR: clj -X:uberjar :aliases '[:datomic :dev]' ...

seancorfield16:07:08

(this is how all "tools" work for the CLI -- where you have :replace-deps so you need to tell the tool how to calculate the "basis" for manipulating the project)

genekim16:07:23

@seancorfield Ohhh…. That makes so much sense. It’s working — thanks so much, @seancorfield! 🙏