boot-clj / boot-new

Generate new projects based on Boot Templates and/or Leiningen Templates!
https://clojars.org/boot/new
Eclipse Public License 1.0
155 stars 42 forks source link

Does not work for `chestnut` #8

Closed pesterhazy closed 8 years ago

pesterhazy commented 8 years ago

Great project, thanks! Works with some templates but fails with https://github.com/plexus/chestnut:

bash-3.2$ boot -d seancorfield/boot-new new -t chestnut -n mychest
Could not load template, failed with: java.lang.NoSuchFieldError: INSTANCE, compiling:(cemerick/pomegranate/aether.clj:42:54)
             clojure.lang.ExceptionInfo: boot.App$Exit: 1
    data: {:file
           "/var/folders/rj/8lnf662s3mlgzv5mcq2r2fnc0000gn/T/boot.user3128045910849527870.clj",
           :line 7}
java.util.concurrent.ExecutionException: boot.App$Exit: 1
                          boot.App$Exit: 1
boot.new/resolve-remote-template/fn   new.clj:   48
   boot.new/resolve-remote-template   new.clj:   48
       boot.new/resolve-template/fn   new.clj:   58
          boot.new/resolve-template   new.clj:   55
                    boot.new/create   new.clj:   89
      boot.new/eval1090/fn/fn/fn/fn   new.clj:  131
         boot.new/eval1090/fn/fn/fn   new.clj:  125
                boot.core/run-tasks  core.clj:  794
                  boot.core/boot/fn  core.clj:  804
clojure.core/binding-conveyor-fn/fn  core.clj: 1916
                                ...```
seancorfield commented 8 years ago

Thank you Paulus! Verified locally. Will investigate and (try to) fix either today or tomorrow. I suspect something in one of those dependencies relies on a different version of Aether than the version Boot supplies.

seancorfield commented 8 years ago

Based on http://stackoverflow.com/questions/27921077/nosuchfielderror-instance-at-org-apache-http-impl-io-defaulthttprequestwriterfac it looks like this is caused by conflicting versions of httpcore being loaded here. Indeed, with the new "verbose" option I just added to Boot new, I see this when brining in the template:

Warning: version conflict detected: org.clojure/clojure version changes from 1.6.0 to 1.7.0
Warning: version conflict detected: org.apache.httpcomponents/httpcore version changes from 4.1.4 to 4.3.2
Warning: version conflict detected: commons-codec version changes from 1.4 to 1.6
Warning: version conflict detected: commons-logging version changes from 1.1.1 to 1.1.3
Warning: version conflict detected: org.apache.httpcomponents/httpclient version changes from 4.1.3 to 4.3.5
seancorfield commented 8 years ago

I'll try isolating the template loading and execution in a Boot pod and see if I can eliminate these conflicts.

seancorfield commented 8 years ago

Fixed in 0.3.1 by loading leiningen-core before the template to better mimic the dependencies that a template sees (FWIW, Chestnut has dependencies that pull in an outdated version of Apache's httpcore library).

plexus commented 8 years ago

Thanks @pesterhazy for the heads up, it seems in this case the culprit is clj-jgit pulling in an outdated jgit, which in turn pulls in the outdated apache stuff.

There's not much movement on clj-jgit at the moment, a PR to upgrade its dependencies has been open since August https://github.com/clj-jgit/clj-jgit/pull/37

I updated Chestnut to use a forked clj-jgit so it can stay current https://github.com/plexus/chestnut/commit/da14e46cd3bf2f75231f8d9d95f6ece62ae17657

(side note: this is the first time I use http://jitpack.io/ but it's really great for cases like these.)