javac并不总是在leiningen项目开始时执行

时间:2015-11-26 14:50:55

标签: java clojure compilation interop leiningen

目前,我有一个项目,直到最近才按预期运行。
我有一个自定义java类,用于连接客户端JMS服务器,以满足当前clojure库无法满足的要求。
I我的项目设置为在启动或构建时编译.java文件,以便包含我所做的任何更改,如果.class文件被意外删除,它将不会崩溃。
最近虽然当我使用lein repl启动项目时,它并不总是编译该类,如果是,它将它放在target / classes目录而不是-d指定的目录中。
我的项目文件如下,对匿名进行了微小的修改:

(defproject my/project "0.0.2-SNAPSHOT"
  :description REDACTED
  :url "http://comapny-name.com"
  :license {:name "company-name Commercial license"
            :url "http://www.company-name.com"}
  :min-lein-version "2.4.3"
  :java-opts ["-Xmx5g" "-server" "-XX:-OmitStackTraceInFastThrow"]
  :exclusions [org.clojure/clojure]
  :dependencies [[my/lib1 "2.1.9"]
                 [my/lib2 "1.2.16" :exclusions [com.taoensso/encore]]
                 [my/lib3 "1.1.1"]
                 [org.clojure/clojure "1.6.0"]
                 [org.clojure/data.zip "0.1.1"]
                 [org.clojure/tools.nrepl "0.2.10"]
                 [com.codahale.metrics/metrics-graphite "3.0.2"]
                 [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/w3thinclient.jar:resources/jars/clojure-1.6.0.jar:resources/jars/log4j-1.2.17.jar:resources/classes/WebLogicListener.class"
                  "-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 ["target/classes"]
  :plugins [[lein-package "2.1.1"]
            [lein-immutant "2.0.1"]]
  :immutant {:war {:resource-paths ["war-resources"]}
             :nrepl {:port REDACTED
                     :host REDACTED
                     :interface REDACTED
                     :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 "http://nexus.company-name.localnet:REDACTED/nexus/content/groups/public"}]])

我的java文件位于java / src中。我在Java 1.7.0_79 Java HotSpot(TM)64位服务器VM上使用Leiningen 2.5.1。

这个project.clj设置用于在每次启动时将.class文件编译为资源/类,直到最近才出现问题。

0 个答案:

没有答案