11
Warning: specified :main without including it in :aot.
If you only need AOT for your uberjar, consider adding :aot :all into your
:uberjar profile instead.
這裏是我的project.clj
(defproject korma-test "0.1.0-SNAPSHOT"
:description "korma db test"
:url "http://example.com/FIXME"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.5.1"]
[korma "0.3.0-RC5"]
]
:main korma-test.core)
,這裏是core.clj
(ns korma-test.core
(require [korma.db :as kdb])
(require [clojure.string :as str])
(:use [clojure.tools.cli])
(:import java.util.Date)
(:gen-class)
)
; Parses for options passed in on the command line.
(defn parse-opts
"Using the newer cli library, parses command line args."
[args]
(cli args
(optional ["-host" "Informix host" :default "localhost"])
(optional ["-port" "Informix host's service port" :default "1498"])
(required ["-username" "user name"])
(required ["-password" "password"])
(optional ["-database" "Informix host's database" :default "stores7/ministores.dbs" ])))
(defn -main
[& args]
(if (= 0 (count args))
(println "Usage: korma-test --host <host-name> --port <port-num> --database <db-name>")
(let [opts (parse-opts args)
start-time (str (Date.))]
(def db-config {:classname "com.informix.jdbc.IfxDriver"
:subprotocol "postgresql"
:subname (format "//%s:(:port opts)/%s"
(:host opts)
(:database opts))
:user (:user opts)
:password (:password opts)})
(kdb/defdb db db-config)
(println opts))))
我很困惑至於在哪裏放:不滿足警告。
您正在運行什麼版本的leiningen以及何時收到警告? – KobbyPemson
@KobbyPemson我沒有發佈所有的core.clj。我得到這個錯誤警告:指定:主要不包括它在:AOT。 隱式AOT:main將在Leiningen 3.0.0中被刪除。 如果你只需要AOT爲你的uberjar,考慮增加:aot:所有到你的 :uberjar配置文件。即使有主要功能。 – octopusgrabbus