leadtune/clj-airbrake — Issue #4: project version is not read correcly when packaged in uberjar
Author: bmabey
Created: 2012-02-08 18:24:32+00:00
State: open

The following error is thrown:

```
Caused by: java.lang.IllegalArgumentException: No implementation of method: :make-reader of protocol: #'clojure.java.io/IOFactory found for class: nil
at clojure.core$_cache_protocol_fn.invoke(core_deftype.clj:495)
at clojure.java.io$fn__7795$G__7790__7802.invoke(io.clj:63)
at clojure.java.io$reader.doInvoke(io.clj:96)
at clojure.lang.RestFn.invoke(RestFn.java:410)
at clojure.lang.AFn.applyToHelper(AFn.java:161)
at clojure.lang.RestFn.applyTo(RestFn.java:132)
at clojure.core$apply.invoke(core.clj:602)
at clojure.core$slurp.doInvoke(core.clj:6024)
at clojure.lang.RestFn.invoke(RestFn.java:410)
at clj_airbrake.core$airbrake_project.invoke(core.clj:26)
at clj_airbrake.core$get_version.invoke(core.clj:33)
at clj_airbrake.core__init.load(Unknown Source)
at clj_airbrake.core__init.(Unknown Source)
... 30 more
```
The bug was introduced in this commit 33fcc1a993. The issue is that there is no project matching `clj-airbrake` in the uberjar's resources causing `slurp` to be called on `nil`.

Inspecting the ubjerjar it seems that all the `clj-airbrake` files included were compiled versions:

```
clj_airbrake/core$xml_ex_response$iter__206__210$fn__211.class
clj_airbrake/core$parse_xml.class
clj_airbrake/core$notify.class
clj_airbrake/core$classloader$fn__194.class
clj_airbrake/core$make_notice.class
clj_airbrake/core$projects.class
clj_airbrake/core__init.class
clj_airbrake/core$xml_ex_response$iter__206__210.class
clj_airbrake/core$airbrake_project$fn__199.class
clj_airbrake/core$airbrake_project.class
clj_airbrake/core$map__GT_xml_vars$iter__222__226$fn__227.class
clj_airbrake/core$map__GT_xml_vars.class
clj_airbrake/core$classloader.class
clj_airbrake/core$send_notice$text_at__245.class
clj_airbrake/core$map__GT_xml_vars$iter__222__226$fn__227$fn__228.class
clj_airbrake/core$sanitize.class
clj_airbrake/core$xml_ex_response.class
clj_airbrake/core$send_notice.class
clj_airbrake/core$xml_ex_response$iter__206__210$fn__211$fn__212.class
clj_airbrake/core$get_version.class
```

I seems like we could get the version at compile time (i.e. bind a var to the results of `get-version`) to avoid having the version form being looked up at runtime. Or perhaps there is a way to prevent the compiling from happening.

Do you have any thoughts/ideas @arohner?