如何将Leiningen模板部署到Clojars?

时间:2013-06-18 14:37:43

标签: clojure leiningen clojurescript clojars

我在我的本地机器上创建了一个Leiningen项目,然后通过执行以下操作变成模板:

lein create-template webdb

:然后我安装模板:

cd webdb
lein install

:这允许我在本地创建基于模板的项目:

lein new webdb anewproject

:到目前为止一切正常。但是,如果我尝试使用以下方法将模板部署到clojars:

cd webdb
lein deploy clojars

:每当我尝试使用clojars配置文件创建模板时,我都会收到错误:

lein new org.clojars.zubairq2/webdb anothernewproject

:给出错误:

Could not find metadata org.clojars.zubairq2/webdb:lein-template/maven-metadata.xml in local (/Users/faroukzquraishi/.m2/repository)
Failure to find org.clojars.zubairq2/webdb:lein-template/maven-metadata.xml in http://repo1.maven.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced
Failure to find org.clojars.zubairq2/webdb:lein-template/maven-metadata.xml in http://clojars.org/repo/ was cached in the local repository, resolution will not be reattempted until the update interval of clojars has elapsed or updates are forced
This could be due to a typo in :dependencies or network issues.
Could not find template org.clojars.zubairq2/webdb on the classpath.

:有谁知道我在这里做错了什么?

更新 - project.clj

(defproject cljstemplate "org.clojars.zubairq2/webdb"
  :dependencies [
                   [org.clojure/clojure "1.5.1"]
                   [org.clojure/google-closure-library-third-party "0.0-2029"]
                   [domina "1.0.1"]
                   [crate "0.2.4"]
                   [prismatic/dommy "0.1.1"]
                   [korma "0.3.0-RC5"]
                   [org.postgresql/postgresql "9.2-1002-jdbc4"]
                   [compojure "1.1.5"]
                   [shoreleave "0.3.0"]
                   [shoreleave/shoreleave-remote-ring "0.3.0"]
                   [ring-middleware-format "0.3.0"]
                   [ring/ring-json "0.2.0"]
                   [jayq "2.3.0"]
                ]

  :url "http://org.clojars.zubair2/webdb"

  :plugins  [
               [lein-cljsbuild "0.3.0"]
               [lein-httpd "1.0.0"]
               [lein-ring "0.8.5"]
            ]

  :source-paths ["src"]

  :ring {:handler webapp.framework.server.core/app}

  :cljsbuild
  {
    :builds
     [
      {
         :source-paths ["src"]
         :compiler     {
                         :output-to      "resources/public/main.js"
                         :optimizations  :simple
                         :externs        ["resources/public/jquery.js" "resources/public/google_maps_api_v3_3.js"]
                         :pretty-print   false
                       }
      }
     ]

  }
)

2 个答案:

答案 0 :(得分:3)

您的上传似乎有效,结果就在这里:

https://clojars.org/webdb/lein-template

你可以制作这样的项目:

arthur@a:~$ lein new webdb newproject
Retrieving webdb/lein-template/0.1.0-SNAPSHOT/lein-template-0.1.0-20130618.143034-5.pom from clojars
Retrieving webdb/lein-template/0.1.0-SNAPSHOT/lein-template-0.1.0-20130618.143034-5.jar from clojars

答案 1 :(得分:2)

要使用lein插件,必须在.lein / profiles.clj中将其设为依赖

由于你的项目是在clojars上,如果你添加它的依赖项,你应该可以使用它。