你好,
我有两个ClojureScript项目。从第一个项目(html-ui-lib)中,我使用以下命令创建了一个JAR文件,并将其安装在本地仓库中
lein with-profile prod jar
lein localrepo install -r /home/muenkel/soft/Global/clojure-repo target/html-ui-lib-0.1.2-SNAPSHOT.jar html-ui-lib 0.1.2-SNAPSHOT
在第二个项目(via-trans)中,我试图使用这个库。为此,我在项目文件中包含了库。不幸的是,JAR文件的所有文件并没有安装。我错在哪了?
以下是JAR文件的内容
通过 Aug 11 00:02:34 CEST 2023 META-INF/MANIFEST.MF
3268 Aug 11 00:02:34 CEST 2023 META-INF/maven/html-ui-lib/html-ui-lib/pom.xml
3183 Aug 11 00:02:34 CEST 2023 META-INF/leiningen/html-ui-lib/html-ui-lib/project.clj
783 Aug 11 00:02:34 CEST 2023 META-INF/leiningen/html-ui-lib/html-ui-lib/README.md
0 Fri Aug 11 00:02:32 CEST 2023 META-INF/
0 Fri Aug 11 00:02:32 CEST 2023 META-INF/maven/
0 Fri Aug 11 00:02:32 CEST 2023 META-INF/maven/html-ui-lib/
0 Fri Aug 11 00:02:32 CEST 2023 META-INF/maven/html-ui-lib/html-ui-lib/
158 Aug 11 00:02:32 CEST 2023 META-INF/maven/html-ui-lib/html-ui-lib/pom.properties
0 Fri Aug 11 00:01:30 CEST 2023 public/
0 Tue Jul 11 23:15:06 CEST 2023 public/css/
2715 Jul 11 23:15:06 CEST 2023 public/css/style.css
151 Mar 26 21:35:54 CEST 2023 public/test.html
0 Fri Aug 11 00:02:32 CEST 2023 public/cljs-out/
554 Apr 17 22:11:34 CEST 2023 public/index.html
417 Apr 08 23:03:08 CEST 2023 public/devcards.html
0 Sat Jul 22 23:08:08 CEST 2023 html_ui_lib/
0 Wed May 10 20:49:58 CEST 2023 html_ui_lib/util/
1100 May 10 20:49:58 CEST 2023 html_ui_lib/util/limit-lines.cljs
1123 May 04 23:27:52 CEST 2023 html_ui_lib/core.cljs
0 Tue Jul 18 21:06:24 CEST 2023 html_ui_lib/spec/
272 Jun 04 00:13:12 CEST 2023 html_ui_lib/spec/email-value-specs.cljs
1883 Jul 18 21:06:24 CEST 2023 html_ui_lib/spec/value_specs.cljs
213 Jun 07 23:31:32 CEST 2023 html_ui_lib/spec/text_value_specs.cljs
3871 Jun 07 23:14:28 CEST 2023 html_ui_lib/spec/ui-specs.cljs
267 Jun 07 23:26:06 CEST 2023 html_ui_lib/spec/number_value_specs.cljs
185 May 20 23:56:54 CEST 2023 html_ui_lib/spec/date_value_specs.cljs
178 May 31 00:26:16 CEST 2023 html_ui_lib/spec/drop_down_value_specs.cljs
1545 Jul 17 22:55:08 CEST 2023 html_ui_lib/spec/type_specs.cljs
0 Tue Jul 18 20:59:58 CEST 2023 html_ui_lib/ui/
3234 Jun 06 21:32:30 CEST 2023 html_ui_lib/ui/input_email.cljs
4298 Jul 18 20:59:58 CEST 2023 html_ui_lib/ui/tree_view.cljs
3361 May 24 22:41:30 CEST 2023 html_ui_lib/ui/input_text.cljs
3420 Jun 03 21:42:24 CEST 2023 html_ui_lib/ui/input_date.cljs
6013 Jun 07 23:35:28 CEST 2023 html_ui_lib/ui/input_number.cljs
2029 Jul 12 22:42:44 CEST 2023 html_ui_lib/ui/core.cljs
396 Apr 07 21:19:26 CEST 2023 html_ui_lib/ui/button.cljs
844 Jul 11 23:13:50 CEST 2023 html_ui_lib/ui/output_boolean.cljs
1127 Jul 12 23:57:34 CEST 2023 html_ui_lib/ui/input_checkbox.cljs
276 Apr 23 22:59:54 CEST 2023 html_ui_lib/ui/grid_container.cljs
603 Jun 08 22:50:00 CEST 2023 html_ui_lib/ui/output_number.cljs
1613 Jul 10 21:58:34 CEST 2023 html_ui_lib/ui/input_radio.cljs
381 Apr 09 00:16:22 CEST 2023 html_ui_lib/ui/table.cljs
1775 Jul 01 22:19:10 CEST 2023 html_ui_lib/ui/drop_down_list.cljs
2789 周三 Jun 28 22:57:44 CEST 2023 html_ui_lib/ui/leaf_template.cljs
313 周四 Jun 08 23:19:22 CEST 2023 html_ui_lib/ui/output_text.cljs
2160 周四 Jul 13 23:36:30 CEST 2023 html_ui_lib/ui/input_password.cljs
519 周三 Jun 07 22:44:34 CEST 2023 html_ui_lib/test_runner.cljs
860 周三 Jun 07 22:57:28 CEST 2023 html_ui_lib/number_value_specs_test.cljs
273 周二 May 24 21:17:16 CEST 2023 html_ui_lib/text_value_specs_test.cljs
1090 周二 May 30 23:24:06 CEST 2023 html_ui_lib/value_specs_test.cljs
7280 周三 Jun 07 23:07:38 CEST 2023 html_ui_lib/ui_specs_test.cljs
2274 周二 May 24 21:37:08 CEST 2023 html_ui_lib/type_specs_test.cljs
305 周二 May 24 23:44:04 CEST 2023 html_ui_lib/drop_down_value_specs_test.cljs
260 周日 Mar 26 21:35:54 CEST 2023 html_ui_lib/core_test.cljs
另一方面,这是库目录的内容。如你所见,这里只包含NS ui的文件。
via-trans/resources/public/cljs-out/dev/html_ui_lib/
└── ui
├── core.cljs
├── core.cljs.cache.json
├── core.js
├── core.js.map
├── input_text.cljs
└── input_text.js
这是html_ui_lib的project.clj文件
(defproject html-ui-lib "0.1.2-SNAPSHOT")
:description "FIXME: write this!"
:url "http://example.com/FIXME"
:license {:name "Eclipse Public License"}
:url "http://www.eclipse.org/legal/epl-v10.html"}
:min-lein-version "2.7.1"
:dependencies [[clj-commons/citrus "3.3.0"]
[cljs-ajax "0.8.1"]
[funcool/struct "1.4.0"]
[org.clojure/clojure "1.10.0"]
[org.clojure/clojurescript "1.11.60"]
[rum "0.12.10"]]
;;:deps {io.github.clj-kondo/config-rum-rum {:mvn/version "0.12.10"}}
:global-vars {warn-on-reflection true}
;;:global-vars {asserts false}
:source-paths ["src/cljs" "test/cljs"]
:aliases {"fig:build" ["trampoline" "run" "-m" "figwheel.main" "-b" "dev" "-r"]}
"fig:min" ["run" "-m" "figwheel.main" "-O" "advanced" "-bo" "dev"]
"prod:build" ["run" "-m" "figwheel.main" "-O" "advanced" "-bo" "prod"]}
:profiles {:dev {:dependencies [[com.bhauman/figwheel-main "0.2.18"]
[org.slf4j/slf4j-nop "1.7.30"]
[com.bhauman/rebel-readline-cljs "0.1.4"]
[devcards "0.2.7"]
;; for informing the linter clj-kondo, that the macros
;; defc etc defines symbols
[io.github.clj-kondo/config-rum-rum "1.0.0"]]
:source-paths ["devcards/cljs"]
:resource-paths ["target"]
;; need to add the compiled assets to the :clean-targets
:clean-targets ^{:protect false} ["target" "resources/public/cljs-out"]
#_:global-vars #_{*asserts* false}}
:prod {:dependencies [[com.bhauman/figwheel-main "0.2.18"]]
:compiler {:optimizations :advanced
:pretty-print false}
:clean-targets ^{:protect false}
["target"
"resources/public/cljs-out/prod"
"resources/public/cljs-out/prod-main.js"]
:cljsbuild {:builds
[{:source-paths ["src/cljs"]
:compiler
{:output-to "resources/public/cljs-out/prod-main.js"
:optimizations :advanced
:pretty-print false}
:build nil}]}
:plugins [[lein-cljsbuild "1.1.8"]]}}
:plugins [[com.github.clj-kondo/lein-clj-kondo "0.2.4"]
[com.fabiodomingues/lein-clj-depend "0.3.0"] ;; Usage: lein clj-depend
;; Detects curcular referencies
[lein-kibit "0.1.8"] ; Code Analyzer: https://github.com/clj-commons/kibit
; Anounced better code alternatives
; Usage: lein kibit
; Automatic: lein auto kibit
; With replace: lein kibit --replace --interactive
])
这里是via-trans的项目文件
(defproject via-trans "0.1.0-SNAPSHOT")
:description "FIXME: write description"
:url "http://example.com/FIXME"
:dependencies [;;[camel-snake-kebab "0.4.3"] ; 用于关键词转换的库
[ch.qos.logback/logback-classic "1.4.4"]
[cljs-ajax "0.8.1"]
[clj-commons/citrus "3.3.0"]
;;[clojure.java-time "1.1.0"]
;;[cljc.java-time "RENAMED"]
[cljc.java-time "0.1.18"]
[conman "0.9.6"] ; Library used for creating functions from sql
[cprop "0.1.19"] ; Configuration
[devcards "0.2.7"]
[expound "0.9.0"]
[funcool/struct "1.4.0"]
[com.layerware/hugsql "0.5.3"] ; Replacement for conman
;[hugsql-adapter-case "0.1.0"] ; case adapter for db table columns
[html-ui-lib "0.1.2-SNAPSHOT"]
[json-html "0.4.7"]
[luminus-transit "0.1.5"]
[luminus-undertow "0.1.18"]
[luminus/ring-ttl-session "0.3.3"]
[org.mariadb.jdbc/mariadb-java-client "1.1.5"]
;;[mysql/mysql-connector-java "8.0.18"]
[markdown-clj "1.11.3"]
[metosin/muuntaja "0.6.8"]
[metosin/reitit "0.5.18"]
[metosin/ring-http-response "0.9.3"]
[mount "0.1.16"]
[nrepl "1.0.0"]
[org.clojure/clojure "1.11.1"]
[org.clojure/clojurescript "1.11.60"]
[org.clojure/tools.cli "1.0.214"]
[org.clojure/tools.logging "1.2.4"]
[org.webjars.npm/bulma "0.9.4"]
[org.webjars.npm/material-icons "1.10.8"]
[org.webjars/webjars-locator "0.45"]
[org.webjars/webjars-locator-jboss-vfs "0.1.0"]
[ring-webjars "0.2.0"]
[ring/ring-core "1.9.6"]
[ring/ring-defaults "0.3.4"]
[rum "0.12.10"]
[selmer "1.12.55"]]
:min-lein-version "2.0.0"
:source-paths ["src/clj" "src/cljc" "src/cljs" "devcards/cljs"]
:test-paths ["test/clj" "test/cljc" "test/cljs"]
:resource-paths ["resources" "target"]
:clean-targets ^{:protect false} ["target" "resources/public/cljs-out"]
:target-path "target/%s/"
:main ^:skip-aot via-trans.core
:plugins []
:profiles
{:uberjar {:omit-source true
:aot :all
:uberjar-name "via-trans.jar"
:source-paths ["env/prod/clj" ]
:resource-paths ["env/prod/resources"]}
:dev [:project/dev :profiles/dev]
:test [:project/dev :project/test :profiles/test]
:project/dev {:jvm-opts ["-Dconf=dev-config.edn" ]}
:dependencies [[com.bhauman/figwheel-main "0.2.18"]
[com.bhauman/rebel-readline-cljs "0.1.4"]
[org.clojure/tools.namespace "1.3.0"]
[pjstadig/humane-test-output "0.11.0"]
[prone "2021-04-23"]
[ring/ring-devel "1.9.6"]
[ring/ring-mock "0.4.0"]]
:plugins [[com.jakemccrary/lein-test-refresh "0.24.1"]
[jonase/eastwood "1.2.4"]
;;[cider/cider-nrepl "0.28.4"] ; ist in .lein/profiles.clj
]
:source-paths ["env/dev/clj" ]
:resource-paths ["env/dev/resources" "target"]
:repl-options {:init-ns user
:timeout 120000}
:injections [(require 'pjstadig.humane-test-output)
(pjstadig.humane-test-output/activate!)]}
:project/test {:jvm-opts ["-Dconf=test-config.edn" ]}
:resource-paths ["env/test/resources"] }
:profiles/dev {}
:profiles/test {}})