You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, even with packaging specified as Clojure, the maven compiler plugin is run before clojure compiler plugin, making classes generated from clojure using :gen-class unavailable for linking.
Would it be possible to generate the clojure class files first and add them to the maven java compiler classpath when it is running?
The text was updated successfully, but these errors were encountered:
I agree it is a catch 22, but a thread reports something funny here:
Even if a java class that is needed is not present, the clojure class is generated (albeit with a warning/error). I looked at the compilation section on clojure's website, and looks like gen-class only generates a stub class, and the implementation is only compiled or linked at runtime.
I guess I am trying to hint towards this: Given the dynamic nature of clojure and the delayed compilation, it is possible to generate the :gen-class stub, not compile the clojure code without any warnings since the java code is not present but it is not really needed also, and then compile the java code that depends on the clojure gen-class.
My understand is limited here, but does clojure:compile goal AOT compile all the clojure code? I remember reading that mostly clojure code is submitted as source in jar and compiled at runtime.
Adding maven-compiler-plugin after clojure-maven-plugin doesn't work since maven-compiler-plugin binds automatically to the compile phase when packaging is jar or clojure and always comes first somehow. The only option is to change packing to pom and then this works.
Currently, even with packaging specified as Clojure, the maven compiler plugin is run before clojure compiler plugin, making classes generated from clojure using :gen-class unavailable for linking.
Would it be possible to generate the clojure class files first and add them to the maven java compiler classpath when it is running?
The text was updated successfully, but these errors were encountered: