首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何将Leiningen模板部署到Clojars?

如何将Leiningen模板部署到Clojars?
EN

Stack Overflow用户
提问于 2013-06-18 22:37:43
回答 2查看 1.5K关注 0票数 4

我已经在本地机器上创建了一个Leiningen项目,然后通过执行以下操作将其转换为模板:

代码语言:javascript
复制
lein create-template webdb

:然后安装模板:

代码语言:javascript
复制
cd webdb
lein install

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

代码语言:javascript
复制
lein new webdb anewproject

:到目前为止,一切都很好。但是,如果我尝试使用以下命令将模板部署到clojars:

代码语言:javascript
复制
cd webdb
lein deploy clojars

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

代码语言:javascript
复制
lein new org.clojars.zubairq2/webdb anothernewproject

:给出错误:

代码语言:javascript
复制
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

代码语言:javascript
复制
(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
                       }
      }
     ]

  }
)
EN

回答 2

Stack Overflow用户

发布于 2013-06-19 02:16:16

您的上传似乎起作用了,结果如下:

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

你可以创建一个这样的项目:

代码语言:javascript
复制
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
票数 3
EN

Stack Overflow用户

发布于 2013-06-19 08:10:39

要使用lein插件,必须使其成为.lein/profiles.clj中的依赖项

由于您的项目是在clojars上进行的,如果您添加了它的依赖项,那么它应该对您可用。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/17171739

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档