【问题标题】:How To Speed Up lein Uberjar Build如何加快 lein Uberjar 构建
【发布时间】:2012-04-09 19:49:44
【问题描述】:

我有一个依赖于几个 Clojure 库的 Clojure“主”应用程序,其中两个是我的。编译阶段,无论是编译还是运行uberjar都需要很长时间。它至少需要一分钟或更长时间。我的库和主库都不是很大。

我的库和主 project.clj 文件包含

  :aot [bene-cmp.core]
  :omit-source true

指令。

如果有的话,我可以做些什么来加快构建过程?

这是三个 project.clj 文件。 project.clj 主目录

;$Log$
;
(defproject bene-cmp "1.0.0-SNAPSHOT"
  :description "This is the main benetrak/GIC comparison program."
  :dependencies [[org.clojure/clojure "1.3.0"]
                 [org.clojure/tools.cli "0.1.0"]
                 [clojure-csv/clojure-csv "1.2.4"]
                 [seesaw "1.4.0"]
                 [bene-csv "1.0.0-SNAPSHOT"]
                 [util "1.0.0-SNAPSHOT"]]
  :aot [bene-cmp.core]
  :omit-source true
  :main bene-cmp.core)

project.clj 库 1

(defproject util "1.0.0-SNAPSHOT"
    ;$Log: project.clj,v $
    ;Revision 1.3  2012/04/04 18:24:36  cvsuser
    ;Take II on comments. (comment ) does not work.
    ;
    ;Revision 1.2  2012/04/04 18:20:54  cvsuser
    ;New library for Clojure. Add CVS comments.

  :description "A general purposes Clojure library"
  :dependencies [[org.clojure/clojure "1.3.0"]
                 [org.clojure/tools.cli "0.1.0"]]
  :aot [util.core]
  :omit-source true)

project.clj 库 2

(defproject bene-csv "1.0.0-SNAPSHOT"
  ;$Log: project.clj,v $
  ;Revision 1.2  2012/04/05 22:50:24  cvsuser
  ;Update and add cvs logging.
  ;
  :description "A csv parsing library"
  :dependencies [[org.clojure/clojure "1.3.0"]
                 [clojure-csv/clojure-csv "1.3.2"]
                 [util "1.0.0-SNAPSHOT"]]
  :aot [bene-csv.core]
  :omit-source true)

【问题讨论】:

    标签: clojure leiningen


    【解决方案1】:

    将 jvm 选项 -Xmx 设置为 2G 或以上。

    【讨论】:

    • 谢谢,但是构建速度差不多。我已将 :jvm-opts ["-Xmx1G"] 添加到我的主库和依赖库中。不过,很高兴了解这一点,+1。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-06-06
    • 1970-01-01
    • 1970-01-01
    • 2018-06-23
    • 2019-01-21
    • 2018-04-25
    相关资源
    最近更新 更多