luminus-framework/luminus

lein uberjar not finding main/:gen-class

owenrh opened this issue · 3 comments

To reproduce:

lein new luminus testit +swagger +war +cljs
cd testit
lein uberjar

Get following warning: Warning: The Main-Class specified does not exist within the jar. It may not be executable as expected. A gen-class directive may be missing in the namespace which contains the main method, or the namespace has not been AOT-compiled.

Jar is not executable as cannot find main class.

Looking at the project the core.clj class with the :gen-class directive is in env/dev/clj/testit/core.clj - which on the face of it seems wrong but maybe I'm missing something?

Versions are as follows:
Leiningen 2.7.1 on Java 1.8.0_131 Java HotSpot(TM) 64-Bit Server VM

If you use the +war flag, then you have to build the release artifact by running lein uberwar as opposed to lein uberjar. The reason that the core namespace is located in the env/dev source path is because a war doesn't use a main.

That totally masks sense. Apologies for the schoolboy error : o

no problem :)