Fork me on GitHub
#component
<
2016-03-13
>
doglooksgood16:03:34

I meet a problem when I try to uberjar with :aot :all:

java.lang.ClassNotFoundException: com.stuartsierra.component.Lifecycle

doglooksgood16:03:00

The code is something like:

clojure
(ns tunnel.datomic
  (:require [datomic.api :as d]
            [com.stuartsierra.component :as component]
            [ :as io])
  (:import datomic.Util))

(defrecord DatomicDatabase [uri schema initial-data connection]
  component/Lifecycle
  (start [component]
    (d/create-database uri)
    (let [c (d/connect uri)]
      @(d/transact c schema)
      @(d/transact c initial-data)
      (assoc component :connection c)))
  (stop [component]
    (d/delete-database uri)
    (assoc component :connection nil)))

(defn new-database [db-uri]
  (DatomicDatabase.
    db-uri
    (first (Util/readAll (io/reader (io/resource "data/schema.edn"))))
    (first (Util/readAll (io/reader (io/resource "data/initial.edn"))))
    nil))