weavejester / lein-ring

Ring plugin for Leiningen
Eclipse Public License 1.0
501 stars 100 forks source link

main missing after updating to Leiningen v2.5 #126

Closed jrevels closed 10 years ago

jrevels commented 10 years ago

After updating to Leiningen v2.5, I get an error when running lein ring uberjar in my project:

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.

I had assumed that ring made a main class itself for the handler I provided; is this not what should happen?

If I go to run the generated uberjar using java -jar, it returns a Invalid or corrupt jarfile error.

Any thoughts?

weavejester commented 10 years ago

It sounds like Leiningen 2.5 has some breaking changes. What version of Lein-Ring are you using?

You could also try to add the following profile:

:uberjar {:aot :all}
tranchis commented 10 years ago

This pull request I've just made should just solve it. In any case, a temporary workaround is to add the following:

:auto-clean false

into project.clj, regardless of whether {:aot :all} is set or not.