Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/clojure/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Clojure 无法从Immutant创建WAR文件_Clojure_War_Immutant - Fatal编程技术网

Clojure 无法从Immutant创建WAR文件

Clojure 无法从Immutant创建WAR文件,clojure,war,immutant,Clojure,War,Immutant,当我试图通过命令创建war文件时 lein with-profile prod immutant war 我得到一个错误声明: 使用配置文件执行任务“immutant”时遇到错误:“prod” Uberjar正在中止,因为jar失败:没有实现方法: :作为协议的文件:#“clojure.java.io/concurtions为类找到: java.lang.Character 我的项目文件如下 (defproject company/project-name "0.0.2-SNAPSHOT"

当我试图通过命令创建war文件时

lein with-profile prod immutant war
我得到一个错误声明:

使用配置文件执行任务“immutant”时遇到错误:“prod” Uberjar正在中止,因为jar失败:没有实现方法: :作为协议的文件:#“clojure.java.io/concurtions为类找到: java.lang.Character

我的项目文件如下

(defproject company/project-name "0.0.2-SNAPSHOT"
  :description "project description"
  :url "http://www.comapny-url.com"
  :license {:name "company name license"
            :url "http://www.company-url.com"}
  :min-lein-version "2.4.3"
  :java-opts ["-Xmx5g" "-server" "-XX:-OmitStackTraceInFastThrow"]
  :exclusions [org.clojure/clojure]
  :dependencies [[company/lib-name1 "1.2.9" :exclusions [com.taoensso/encore]]
                 [company/lib-name2 "1.1.1"]
                 [org.clojure/clojure "1.6.0"]
                 [org.clojure/data.zip "0.1.1"]
                 [org.clojure/tools.nrepl "0.2.10"]
                 [com.palletops/leaven "0.3.1"]
                 [com.github.kyleburton/clj-xpath "1.4.5"]
                 [metrics-clojure "2.5.1"]]
  :java-source-paths ["java/src"]
  :javac-options ["-target" "1.7" 
                  "-source" "1.7" "-Xlint:-options" 
                  "-cp" "resources/jars/jms-lib.jar:resources/jars/clojure-1.6.0.jar:resources/jars/log4j-1.2.17.jar"
                  "-d" "resources/classes"]
  :profiles {:dev {:source-paths ["dev"]
                   :dependencies [[org.clojure/tools.namespace "0.2.11"]]
                   :plugins [[lein-package "2.1.1"]
                             [lein-marginalia "0.7.1"]]}
             :prod {:source-paths "prod"
                    :main prod}}
  :prep-tasks ["javac" "compile"]
  :resource-paths ["resources/classes"]
  :plugins [[lein-package "2.1.1"]
            [lein-immutant "2.0.1"]]
  :immutant {:war {:resource-paths ["war-resources"]}
             :nrepl {:port 8183
                     :host "0.0.0.0"
                     :interface "0.0.0.0"
                     :start? true}}
  :hooks [leiningen.package.hooks.deploy leiningen.package.hooks.install]
  :package {:skipjar true
            :autobuild true
            :reuse false
            :artifacts [{:build "with-profile prod immutant war --name=%p%v%t" :extension "war"}]}
  :uberjar-exclusions [#"(?i)^META-INF/[^/]*\.SF$"] ;; Eliminate the signing code from the uberjar
  :repositories ^:replace [["nexus" {:url "comapny.respository.net"}]])
产品配置文件的布局如下所示

(ns prod
      (:require  
        [company.lib-name3
         [debug :as debug]
         [system :refer (go)]])
  (:gen-class))

(defn -main
  "Initialize and start the app as a war"
  []
  (go))
如果我使用我的开发人员配置文件,我可以构建一个uberjar,其布局如下:

(ns user
    "Tools for interactive development with the REPL. This file should
    not be included in a production build of the application."
    (:require  [clojure.java.io :as io]
        [clojure.java.javadoc :refer  (javadoc)]
        [clojure.pprint :refer  (pprint)]
        [clojure.reflect :refer  (reflect)]
        [clojure.repl :refer  (apropos dir doc find-doc pst source)]
        [clojure.set :as set]
        [clojure.string :as str]
        [clojure.test :as test]
        [clojure.tools.namespace.repl :refer  (refresh refresh-all)]
        [company.lib-name3
         [debug :as debug]
         [system :refer (go)]]))

(defn -main
  []
  (go))

myproject.clj文件的prod概要文件中的源路径必须是向量,而不仅仅是字符串

:profiles {:dev {:source-paths ["dev"]
                   :dependencies [[org.clojure/tools.namespace "0.2.11"]]
                   :plugins [[lein-package "2.1.1"]
                             [lein-marginalia "0.7.1"]]}
             :prod {:source-paths ["prod"]
                    :main prod}}
而不是

:profiles {:dev {:source-paths ["dev"]
                   :dependencies [[org.clojure/tools.namespace "0.2.11"]]
                   :plugins [[lein-package "2.1.1"]
                             [lein-marginalia "0.7.1"]]}
             :prod {:source-paths "prod"
                    :main prod}}

更新了我的开发人员配置文件,它确实构建了一个war