technomancy / leiningen

Moved to Codeberg; this is a convenience mirror
https://codeberg.org/leiningen/leiningen
Other
7.29k stars 1.6k forks source link

Should warn about ignored forms appearing in `profiles.clj` #2140

Open csakoda opened 8 years ago

csakoda commented 8 years ago

I was hitting an issue building uberjars in a project I work on.

The error, for reference, was

$ lein with-profile production uberjar
Error: Could not find or load main class clojure.main
Compilation failed: Subprocess failed
Uberjar aborting because jar failed: Compilation failed: Subprocess failed
Error encountered performing task 'uberjar' with profile(s): 'production'
Uberjar aborting because jar failed: Compilation failed: Subprocess failed

The issue turned out to be I had a legal ~/.lein/profiles.clj, but the relevant section (:uberjar) was outside the closing bracket. It took me a bit of digging to notice that, future users of leiningen might appreciate a warning about ignored garbage detected after the first form in profiles.clj

{:user {:plugins [
                  [lein-repo "0.2.1"]
                  [cider/cider-nrepl "0.12.0"]
                  ]
        :dependencies [[org.clojure/tools.nrepl "0.2.12"]]}} ;; form actually closes here

 :uberjar {:plugins [
                     [lein-repo "0.2.1"]
                    ]}} ;; should have been closed here

Thanks for all the hard work on this great project!

hypirion commented 8 years ago

Yeah, agreed that this could be improved when reading profiles.