Question

When I try to create an uberjar using lein with the following very simple Clojure test file, I get an error

Compiling korma-test.core
Exception in thread "main" java.lang.Exception: 
lib names inside prefix lists must not contain periods, compiling:(core.clj:1:1)

and cannot figure out why. I got the (use 'korma.db) from sqlkorma.com's docs section, and tried a require statement as well (not listed in my examples here).

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 (simplified)

(ns korma-test.core
  (:gen-class)
  (use 'korma.db)
  (require '[clojure.string :as str])
  (:import java.util.Date)
)

(defn -main 
  [& args]
  (let [opts (parse-opts args)
        start-time (str (Date.))]))
Was it helpful?

Solution

The ns macro uses keywords in place of functions and does take quoted arguments.

(ns korma-test.core
  ...
  (:use korma.db)
  (:require [clojure.string :as str])
  ...)

There is a nice write-up here: http://blog.8thlight.com/colin-jones/2010/12/05/clojure-libs-and-namespaces-require-use-import-and-ns.html

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top