<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Clojure Q&amp;A - Recent questions tagged leiningen</title>
<link>https://ask.clojure.org/index.php/tag/leiningen</link>
<description></description>
<item>
<title>How to call a function in another ns in lein repl?</title>
<link>https://ask.clojure.org/index.php/14330/how-to-call-a-function-in-another-ns-in-lein-repl</link>
<description>&lt;p&gt;Clojure beginner here.&lt;/p&gt;
&lt;p&gt;I've created a leiningen project &quot;adventofcode&quot; and I've created a file &quot;src/adventofcode/2024/day7.clj&quot; with this namespace:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(ns adventofcode.2024.day7
  (:gen-class)
  (:require
    [clojure.math]
    [clojure.math.combinatorics]
    [clojure.pprint]))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now when I run &lt;code&gt;lein repl&lt;/code&gt; the prompt is &lt;code&gt;adventofcode.core&lt;/code&gt;. How can I call a function in the file above? Or switch to the namespace &lt;code&gt;adventofcode.2024&lt;/code&gt;? Tab completion suggests that this namespace doesn't exist. Do I manually have to load the file somehow?&lt;/p&gt;
&lt;p&gt;I'm just starting out. If I'm making my life unnecessarily hard with this project structure I wouldn't mind a comment on that too.&lt;/p&gt;
</description>
<category>Beginner</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14330/how-to-call-a-function-in-another-ns-in-lein-repl</guid>
<pubDate>Sat, 11 Jan 2025 23:30:45 +0000</pubDate>
</item>
<item>
<title>Problem with leiningen and a local library</title>
<link>https://ask.clojure.org/index.php/13157/problem-with-leiningen-and-a-local-library</link>
<description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I have two ClojureScript projects. From the first one (html-ui-lib) I created a JAR file with the following commands and installed it in a local repository:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;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
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In the second project (via-trans) I try to use this library. For this purpose I have included the library in the project file. Unfortunately, not all files of the JAR file are installed. What am I doing wrong?&lt;/p&gt;
&lt;p&gt;Here is the content of the JAR file:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt; 245 Fri Aug 11 00:02:34 CEST 2023 META-INF/MANIFEST.MF&lt;br&gt;
  3268 Fri Aug 11 00:02:34 CEST 2023 META-INF/maven/html-ui-lib/html-ui-lib/pom.xml&lt;br&gt;
  3183 Fri Aug 11 00:02:34 CEST 2023 META-INF/leiningen/html-ui-lib/html-ui-lib/project.clj&lt;br&gt;
   783 Fri Aug 11 00:02:34 CEST 2023 META-INF/leiningen/html-ui-lib/html-ui-lib/README.md&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; 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/
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;   158 Fri Aug 11 00:02:32 CEST 2023 META-INF/maven/html-ui-lib/html-ui-lib/pom.properties&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; 0 Fri Aug 11 00:01:30 CEST 2023 public/
 0 Tue Jul 11 23:15:06 CEST 2023 public/css/
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;  2715 Tue Jul 11 23:15:06 CEST 2023 public/css/style.css&lt;br&gt;
   151 Sun Mar 26 21:35:54 CEST 2023 public/test.html&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; 0 Fri Aug 11 00:02:32 CEST 2023 public/cljs-out/
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;   554 Mon Apr 17 22:11:34 CEST 2023 public/index.html&lt;br&gt;
   417 Sat Apr 08 23:03:08 CEST 2023 public/devcards.html&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; 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/
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;  1100 Wed May 10 20:49:58 CEST 2023 html_ui_lib/util/limit-lines.cljs&lt;br&gt;
  1123 Thu May 04 23:27:52 CEST 2023 html_ui_lib/core.cljs&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; 0 Tue Jul 18 21:06:24 CEST 2023 html_ui_lib/spec/
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;   272 Sun Jun 04 00:13:12 CEST 2023 html_ui_lib/spec/email-value-specs.cljs&lt;br&gt;
  1883 Tue Jul 18 21:06:24 CEST 2023 html_ui_lib/spec/value_specs.cljs&lt;br&gt;
   213 Wed Jun 07 23:31:32 CEST 2023 html_ui_lib/spec/text_value_specs.cljs&lt;br&gt;
  3871 Wed Jun 07 23:14:28 CEST 2023 html_ui_lib/spec/ui-specs.cljs&lt;br&gt;
   267 Wed Jun 07 23:26:06 CEST 2023 html_ui_lib/spec/number_value_specs.cljs&lt;br&gt;
   185 Sat May 20 23:56:54 CEST 2023 html_ui_lib/spec/date_value_specs.cljs&lt;br&gt;
   178 Wed May 31 00:26:16 CEST 2023 html_ui_lib/spec/drop_down_value_specs.cljs&lt;br&gt;
  1545 Mon Jul 17 22:55:08 CEST 2023 html_ui_lib/spec/type_specs.cljs&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; 0 Tue Jul 18 20:59:58 CEST 2023 html_ui_lib/ui/
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;  3234 Tue Jun 06 21:32:30 CEST 2023 html_ui_lib/ui/input_email.cljs&lt;br&gt;
  4298 Tue Jul 18 20:59:58 CEST 2023 html_ui_lib/ui/tree_view.cljs&lt;br&gt;
  3361 Wed May 24 22:41:30 CEST 2023 html_ui_lib/ui/input_text.cljs&lt;br&gt;
  3420 Sat Jun 03 21:42:24 CEST 2023 html_ui_lib/ui/input_date.cljs&lt;br&gt;
  6013 Wed Jun 07 23:35:28 CEST 2023 html_ui_lib/ui/input_number.cljs&lt;br&gt;
  2029 Wed Jul 12 22:42:44 CEST 2023 html_ui_lib/ui/core.cljs&lt;br&gt;
   396 Fri Apr 07 21:19:26 CEST 2023 html_ui_lib/ui/button.cljs&lt;br&gt;
   844 Tue Jul 11 23:13:50 CEST 2023 html_ui_lib/ui/output_boolean.cljs&lt;br&gt;
  1127 Wed Jul 12 23:57:34 CEST 2023 html_ui_lib/ui/input_checkbox.cljs&lt;br&gt;
   276 Sun Apr 23 22:59:54 CEST 2023 html_ui_lib/ui/grid_container.cljs&lt;br&gt;
   603 Thu Jun 08 22:50:00 CEST 2023 html_ui_lib/ui/output_number.cljs&lt;br&gt;
  1613 Mon Jul 10 21:58:34 CEST 2023 html_ui_lib/ui/input_radio.cljs&lt;br&gt;
   381 Sun Apr 09 00:16:22 CEST 2023 html_ui_lib/ui/table.cljs&lt;br&gt;
  1775 Sat Jul 01 22:19:10 CEST 2023 html_ui_lib/ui/drop_down_list.cljs&lt;br&gt;
  2789 Wed Jun 28 22:57:44 CEST 2023 html_ui_lib/ui/leaf_template.cljs&lt;br&gt;
   313 Thu Jun 08 23:19:22 CEST 2023 html_ui_lib/ui/output_text.cljs&lt;br&gt;
  2160 Thu Jul 13 23:36:30 CEST 2023 html_ui_lib/ui/input_password.cljs&lt;br&gt;
   519 Wed Jun 07 22:44:34 CEST 2023 html_ui_lib/test_runner.cljs&lt;br&gt;
   860 Wed Jun 07 22:57:28 CEST 2023 html_ui_lib/number_value_specs_test.cljs&lt;br&gt;
   273 Wed May 24 21:17:16 CEST 2023 html_ui_lib/text_value_specs_test.cljs&lt;br&gt;
  1090 Tue May 30 23:24:06 CEST 2023 html_ui_lib/value_specs_test.cljs&lt;br&gt;
  7280 Wed Jun 07 23:07:38 CEST 2023 html_ui_lib/ui_specs_test.cljs&lt;br&gt;
  2274 Wed May 24 21:37:08 CEST 2023 html_ui_lib/type_specs_test.cljs&lt;br&gt;
   305 Wed May 24 23:44:04 CEST 2023 html_ui_lib/drop_down_value_specs_test.cljs&lt;br&gt;
   260 Sun Mar 26 21:35:54 CEST 2023 html_ui_lib/core_test.cljs&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Here, on the other hand, is the content of the directory with the library. As you can see, only the files of the namespace ui are contained here:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;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
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Here is the project.clj file of html_ui_lib:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;(defproject html-ui-lib &quot;0.1.2-SNAPSHOT&quot;&lt;br&gt;
  :description &quot;FIXME: write this!&quot;&lt;br&gt;
  :url &quot;&lt;a rel=&quot;nofollow&quot; href=&quot;http://example.com/FIXME&quot;&gt;http://example.com/FIXME&lt;/a&gt;&quot;&lt;br&gt;
  :license {:name &quot;Eclipse Public License&quot;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;        :url &quot;http://www.eclipse.org/legal/epl-v10.html&quot;}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;  :min-lein-version &quot;2.7.1&quot;&lt;br&gt;
  :dependencies [[clj-commons/citrus &quot;3.3.0&quot;]&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;             [cljs-ajax &quot;0.8.1&quot;]
             [funcool/struct &quot;1.4.0&quot;]
             [org.clojure/clojure &quot;1.10.0&quot;]
             [org.clojure/clojurescript &quot;1.11.60&quot;]
             [rum &quot;0.12.10&quot;]]
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;;;:deps {io.github.clj-kondo/config-rum-rum {:mvn/version &quot;0.12.10&quot;}}&lt;br&gt;
  :global-vars {&lt;em&gt;warn-on-reflection&lt;/em&gt; true}&lt;br&gt;
  ;;:global-vars {&lt;em&gt;asserts&lt;/em&gt; false}&lt;br&gt;
  :source-paths [&quot;src/cljs&quot; &quot;test/cljs&quot;]&lt;br&gt;
  :aliases {&quot;fig:build&quot; [&quot;trampoline&quot; &quot;run&quot; &quot;-m&quot; &quot;figwheel.main&quot; &quot;-b&quot; &quot;dev&quot; &quot;-r&quot;]&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;        &quot;fig:min&quot;   [&quot;run&quot; &quot;-m&quot; &quot;figwheel.main&quot; &quot;-O&quot; &quot;advanced&quot; &quot;-bo&quot; &quot;dev&quot;]
        &quot;prod:build&quot; [&quot;run&quot; &quot;-m&quot; &quot;figwheel.main&quot; &quot;-O&quot; &quot;advanced&quot; &quot;-bo&quot; &quot;prod&quot;]}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;  :profiles {:dev {:dependencies [[com.bhauman/figwheel-main &quot;0.2.18&quot;]&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;                              [org.slf4j/slf4j-nop &quot;1.7.30&quot;]
                              [com.bhauman/rebel-readline-cljs &quot;0.1.4&quot;]
                              [devcards &quot;0.2.7&quot;]
                              ;; for informing the linter clj-kondo, that the macros
                              ;; defc etc defines symbols
                              [io.github.clj-kondo/config-rum-rum &quot;1.0.0&quot;]]
               :source-paths [&quot;devcards/cljs&quot;]
               :resource-paths [&quot;target&quot;]
               ;; need to add the compiled assets to the :clean-targets
               :clean-targets ^{:protect false} [&quot;target&quot; &quot;resources/public/cljs-out&quot;]
               #_:global-vars #_{*asserts* false}}
         :prod {:dependencies [[com.bhauman/figwheel-main &quot;0.2.18&quot;]]
                :compiler {:optimizations :advanced
                           :pretty-print false}
                :clean-targets ^{:protect false}
                [&quot;target&quot;
                 &quot;resources/public/cljs-out/prod&quot;
                 &quot;resources/public/cljs-out/prod-main.js&quot;]
                :cljsbuild {:builds
                            [{:source-paths [&quot;src/cljs&quot;]
                              :compiler
                              {:output-to &quot;resources/public/cljs-out/prod-main.js&quot;
                               :optimizations :advanced
                               :pretty-print false}
                              :build nil}]}
                :plugins [[lein-cljsbuild &quot;1.1.8&quot;]]}}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;  :plugins [[com.github.clj-kondo/lein-clj-kondo &quot;0.2.4&quot;]&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;        [com.fabiodomingues/lein-clj-depend &quot;0.3.0&quot;] ;; Usage: lein clj-depend
        ;; Detects curcular referencies
        [lein-kibit &quot;0.1.8&quot;] ; 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
        ])
&lt;/code&gt;&lt;/pre&gt;
&lt;/blockquote&gt;
&lt;p&gt;Here is the project file of via-trans:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;(defproject via-trans &quot;0.1.0-SNAPSHOT&quot;&lt;br&gt;
  :description &quot;FIXME: write description&quot;&lt;br&gt;
  :url &quot;&lt;a rel=&quot;nofollow&quot; href=&quot;http://example.com/FIXME&quot;&gt;http://example.com/FIXME&lt;/a&gt;&quot;&lt;br&gt;
  :dependencies [;;[camel-snake-kebab &quot;0.4.3&quot;] ; Libray used for converting keywords&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;             [ch.qos.logback/logback-classic &quot;1.4.4&quot;]
             [cljs-ajax &quot;0.8.1&quot;]
             [clj-commons/citrus &quot;3.3.0&quot;]
             ;;[clojure.java-time &quot;1.1.0&quot;]
             ;;[cljc.java-time &quot;RENAMED&quot;]
             [cljc.java-time &quot;0.1.18&quot;]
             [conman &quot;0.9.6&quot;] ; Library used for creating functions from sql
             [cprop &quot;0.1.19&quot;]   ; Configuration
             [devcards &quot;0.2.7&quot;]
             [expound &quot;0.9.0&quot;]
             [funcool/struct &quot;1.4.0&quot;]
             [com.layerware/hugsql &quot;0.5.3&quot;] ; Replacement for conman
             ;[hugsql-adapter-case &quot;0.1.0&quot;] ; case adapter for db table columns 
             [html-ui-lib &quot;0.1.2-SNAPSHOT&quot;]
             [json-html &quot;0.4.7&quot;]
             [luminus-transit &quot;0.1.5&quot;]
             [luminus-undertow &quot;0.1.18&quot;]
             [luminus/ring-ttl-session &quot;0.3.3&quot;]
             [org.mariadb.jdbc/mariadb-java-client &quot;1.1.5&quot;]
             ;;[mysql/mysql-connector-java &quot;8.0.18&quot;]
             [markdown-clj &quot;1.11.3&quot;]
             [metosin/muuntaja &quot;0.6.8&quot;]
             [metosin/reitit &quot;0.5.18&quot;]
             [metosin/ring-http-response &quot;0.9.3&quot;]
             [mount &quot;0.1.16&quot;]
             [nrepl &quot;1.0.0&quot;]
             [org.clojure/clojure &quot;1.11.1&quot;]
             [org.clojure/clojurescript &quot;1.11.60&quot;]
             [org.clojure/tools.cli &quot;1.0.214&quot;]
             [org.clojure/tools.logging &quot;1.2.4&quot;]
             [org.webjars.npm/bulma &quot;0.9.4&quot;]
             [org.webjars.npm/material-icons &quot;1.10.8&quot;]
             [org.webjars/webjars-locator &quot;0.45&quot;]
             [org.webjars/webjars-locator-jboss-vfs &quot;0.1.0&quot;]
             [ring-webjars &quot;0.2.0&quot;]
             [ring/ring-core &quot;1.9.6&quot;]
             [ring/ring-defaults &quot;0.3.4&quot;]
             [rum &quot;0.12.10&quot;]
             [selmer &quot;1.12.55&quot;]]
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;  :min-lein-version &quot;2.0.0&quot;&lt;br&gt;
  :source-paths [&quot;src/clj&quot; &quot;src/cljc&quot; &quot;src/cljs&quot; &quot;devcards/cljs&quot;]&lt;br&gt;
  :test-paths [&quot;test/clj&quot; &quot;test/cljc&quot; &quot;test/cljs&quot;]&lt;br&gt;
  :resource-paths [&quot;resources&quot; &quot;target&quot;]&lt;br&gt;
  :clean-targets ^{:protect false} [&quot;target&quot; &quot;resources/public/cljs-out&quot;]&lt;br&gt;
  :target-path &quot;target/%s/&quot;&lt;br&gt;
  :main ^:skip-aot via-trans.core&lt;br&gt;
  :plugins [] &lt;br&gt;
  :profiles&lt;br&gt;
  {:uberjar {:omit-source true&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;         :aot :all
         :uberjar-name &quot;via-trans.jar&quot;
         :source-paths [&quot;env/prod/clj&quot; ]
         :resource-paths [&quot;env/prod/resources&quot;]}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;   :dev           [:project/dev :profiles/dev]&lt;br&gt;
   :test          [:project/dev :project/test :profiles/test]&lt;br&gt;
   :project/dev  {:jvm-opts [&quot;-Dconf=dev-config.edn&quot; ]&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;              :dependencies [[com.bhauman/figwheel-main &quot;0.2.18&quot;]
                             [com.bhauman/rebel-readline-cljs &quot;0.1.4&quot;]
                             [org.clojure/tools.namespace &quot;1.3.0&quot;]
                             [pjstadig/humane-test-output &quot;0.11.0&quot;]
                             [prone &quot;2021-04-23&quot;]
                             [ring/ring-devel &quot;1.9.6&quot;]
                             [ring/ring-mock &quot;0.4.0&quot;]]
              :plugins      [[com.jakemccrary/lein-test-refresh &quot;0.24.1&quot;]
                             [jonase/eastwood &quot;1.2.4&quot;]
                             ;;[cider/cider-nrepl &quot;0.28.4&quot;] ; ist in .lein/profiles.clj
                             ]   
              :source-paths [&quot;env/dev/clj&quot; ]
              :resource-paths [&quot;env/dev/resources&quot; &quot;target&quot;]
              :repl-options {:init-ns user
                             :timeout 120000}
              :injections [(require 'pjstadig.humane-test-output)
                           (pjstadig.humane-test-output/activate!)]}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;   :project/test {:jvm-opts [&quot;-Dconf=test-config.edn&quot; ]&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;              :resource-paths [&quot;env/test/resources&quot;] }
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;   :profiles/dev {}&lt;br&gt;
   :profiles/test {}})&lt;/p&gt;
&lt;/blockquote&gt;
</description>
<category>Leiningen</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/13157/problem-with-leiningen-and-a-local-library</guid>
<pubDate>Sun, 13 Aug 2023 07:35:33 +0000</pubDate>
</item>
<item>
<title>How to get Clojurescript REPL in Calva (Lein + Figwheel main)</title>
<link>https://ask.clojure.org/index.php/11759/how-to-get-clojurescript-repl-in-calva-lein-figwheel-main</link>
<description>&lt;p&gt;Hi, I trying to setup editor for Clojure, currently struggling with Calva. I have fullstack project (cljs via Figwheel main) and whe I run repl (jack-in) then both repls get started (Lein + Figwheel Main config), but I cant switch to cljs repl, geting error &quot;Cannot read properties of null (reading 'switchNS')&quot;&lt;/p&gt;
</description>
<category>Calva</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/11759/how-to-get-clojurescript-repl-in-calva-lein-figwheel-main</guid>
<pubDate>Tue, 12 Apr 2022 04:27:18 +0000</pubDate>
</item>
<item>
<title>database updates executed with lein repl, but not with lein run</title>
<link>https://ask.clojure.org/index.php/9882/database-updates-executed-with-lein-repl-but-not-with-lein-run</link>
<description>&lt;p&gt;Hi all,&lt;/p&gt;
&lt;p&gt;I have a script that updates data in a MongoDB database using the monger library. All updates are performed when I open a repl and copy/paste the code, but I can't get it to work with &lt;code&gt;lein run&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The relevant code:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(ns covid-data-management.core
(:require [oz.core :as oz]
                  [monger.core :as mg]
                  [monger.collection :as mc]))
(defonce db (mg/get-db (mg/connect) &quot;covid19&quot;))
(def coll &quot;surveys&quot;)
(defn update-symptoms []
    (println &quot;In the update-symptoms definitions&quot;)
    (map (fn [x]
            (mc/update db coll {} {&quot;$set&quot; {:symptoms [&quot;symptom1&quot; &quot;symptom2&quot;]}}))))

(defn main [&amp;amp; args]
    (update-symptoms))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Copy/pasting the code in the REPL does exactly what it should do: set the new symptoms. When running with &lt;code&gt;lein run&lt;/code&gt;, the string &quot;In the update-symptoms definitions&quot; is printed to the console, but the database itself is not changed.&lt;/p&gt;
&lt;p&gt;I suspect that it has to do with the no-side-effects and lazy features of clojure but haven't found the solution yet. Any help appreciated!&lt;/p&gt;
&lt;p&gt;Thank you,&lt;br&gt;
j.&lt;/p&gt;
</description>
<category>REPL</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/9882/database-updates-executed-with-lein-repl-but-not-with-lein-run</guid>
<pubDate>Fri, 27 Nov 2020 11:49:54 +0000</pubDate>
</item>
<item>
<title>Can you specify the location .nrepl-port file is written to?</title>
<link>https://ask.clojure.org/index.php/9691/can-you-specify-the-location-nrepl-port-file-is-written-to</link>
<description>&lt;p&gt;It  seems that the default location of the .nrepl-port file is where the &lt;code&gt;lein&lt;/code&gt; command is run. I need to override this since I don't have permission to write files in the directory I have to run. Specifically I'm running:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;lein update-in :dependencies conj \[nrepl\ \&quot;0.8.2\&quot;\] -- update-in :plugins conj \[cider/cider-nrepl\ \&quot;0.25.3\&quot;\] -- repl :headless :host localhost &lt;/code&gt;&lt;/p&gt;
&lt;p&gt;I browsed the source code of leiningen for &lt;code&gt;.nrepl-port&lt;/code&gt; and saw &lt;code&gt;:root&lt;/code&gt; is set somewhere. I tried passing that in but it didn't seem to affect anything.&lt;/p&gt;
</description>
<category>REPL</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/9691/can-you-specify-the-location-nrepl-port-file-is-written-to</guid>
<pubDate>Wed, 07 Oct 2020 05:28:48 +0000</pubDate>
</item>
<item>
<title>how to require clojure libs as classes instead of clj file to reduce repl start up time during development?</title>
<link>https://ask.clojure.org/index.php/9681/require-clojure-classes-instead-reduce-during-development</link>
<description>&lt;p&gt;Hi!&lt;/p&gt;
&lt;p&gt;i read about &lt;a rel=&quot;nofollow&quot; href=&quot;http://%20https://clojure.org/guides/dev_startup_time&quot;&gt;reducing repl start up time during dev&lt;/a&gt;  and tried to apply these knowledge to start REPL using Leiningen (in the article Alex shows this practice using deps.edn).&lt;/p&gt;
&lt;p&gt;My steps:&lt;/p&gt;
&lt;p&gt;I overrided clojure.core/load var to track time elapsed on loading module with:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(alter-var-root #'clojure.core/load (fn [origin-fn]
                                  (if (get (meta origin-fn) ::track-load?)
                                    origin-fn
                                    (vary-meta (fn [&amp;amp; args]
                                                 (let [start# (System/nanoTime)
                                                       ret# (apply origin-fn args)
                                                       elapsed-ms# (/ (double (- (System/nanoTime) start#)) 1000000.0)]
                                                   (newline)
                                                   (pr {:args (vec args)
                                                        :ms   elapsed-ms#})
                                                   (newline)
                                                   ret#))
                                               merge
                                               {::track-load? true}))))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I noticed that loading core clojure parts takes time ~0.10-0.20 ms and loading third party libs modules (cheshire for example) , takes ~200-400ms.&lt;/p&gt;
&lt;p&gt;As i understand,  main idea of reducing REPL start up time  is the priority of compiled class before clj module if  clj module was not changed. So we can compile third party libs and get benefit of not parsing their clj files but use their compiled classes.&lt;/p&gt;
&lt;p&gt;I compiled all clojure files (my and libs) via leiningen uberjar and added folder with compiled class files to :checkout-deps-shares, i guess it is a way to add folder with class files to classpath:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;:checkout-deps-shares [:source-paths :test-paths
                     ~(fn [p] (str (:root p) &quot;/target/uberjar/classes/*&quot;))]
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Then i restarted repl, overrided clojure.core/load to track modules load time and as experiment do following:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(time (require 'runtime.account :reload-all))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;where runtime.account is one of my root modules.&lt;/p&gt;
&lt;p&gt;As a result i cannot see any difference in loading time of third party libs modules :/.&lt;/p&gt;
&lt;p&gt;Maybe you can give me some details about mechanism deciding to load class file or clj file and some way to monitor that activity?&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;
</description>
<category>REPL</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/9681/require-clojure-classes-instead-reduce-during-development</guid>
<pubDate>Sat, 03 Oct 2020 07:32:25 +0000</pubDate>
</item>
<item>
<title>Lein repl error: As of 2.8.2, the repl task is incompatible with Clojure versions older than 1.7.0.</title>
<link>https://ask.clojure.org/index.php/9599/lein-repl-error-incompatible-with-clojure-versions-older-than</link>
<description>&lt;p&gt;I am trying to work through an example in the Clojure Workshop. I created a folder and in that included the following &lt;code&gt;project.clj&lt;/code&gt; file.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(defproject learncsv &quot;1.0.0-SNAPSHOT&quot;
 :dependencies [[org.clojure/data.csv &quot;1.0.0&quot;]
             [semantic-csv &quot;0.2.1-alpha1&quot;]])
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Then, I went to the terminal and typed &lt;/p&gt;
&lt;pre&gt;&lt;code&gt;lein repl
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I got the following error:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;OpenJDK 64-Bit Server VM warning: Options -Xverify:none and -noverify were deprecated 

in JDK 13 and will likely be removed in a future release.
As of 2.8.2, the repl task is incompatible with Clojure versions older than 1.7.0.
You can downgrade to 2.8.1 or use `lein trampoline run -m clojure.main` for a simpler 
 fallback repl.
Subprocess failed (exit code: 1)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I am super new to clojure. Never included any dependencies. Would really appreciate any help. &lt;/p&gt;
&lt;p&gt;Edit: If I run &lt;code&gt;lein repl&lt;/code&gt; in a folder that does not have any project.clj then it starts fine. And, it shows my clojure version as 1.10. So I am not sure why the error seems to suggest that I am using Clojure version older than 1.7.0&lt;/p&gt;
&lt;p&gt;Thank you.&lt;/p&gt;
</description>
<category>REPL</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/9599/lein-repl-error-incompatible-with-clojure-versions-older-than</guid>
<pubDate>Fri, 11 Sep 2020 23:06:45 +0000</pubDate>
</item>
<item>
<title>reagent undefined in clj-cljs setup</title>
<link>https://ask.clojure.org/index.php/9311/reagent-undefined-in-clj-cljs-setup</link>
<description>&lt;p&gt;I have a project setup where I want to serve my clojurescript from my clojure server and I want to keep all in one repo, if possible. The server works and returns the static resources including reagent files. However, when the &lt;code&gt;app.js&lt;/code&gt; is processed, I get the following console ouput:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;core.cljs?rel=1589815066414:6  undefined
core.cljs?rel=1589815066414:8  Uncaught TypeError: Cannot read property 'call' of undefined
    at core.cljs?rel=1589815066414:8
(anonymous) @ core.cljs?rel=1589815066414:8
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;To my eyes everything in my code looks the way it should be.&lt;/p&gt;
&lt;p&gt;This is my &lt;code&gt;core.cljs&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(ns ws-poc.core
  (:require
   [reagent.core :as reagent]))
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;(.log js/console reagent) ;; &amp;lt;== reagent is undefined, see first line of log

(reagent/render-component
 [:h1 Works!]
 (. js/document (getElementById &quot;app&quot;)))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This is my &lt;code&gt;index.html&lt;/code&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html&amp;gt;
  &amp;lt;head&amp;gt;
    &amp;lt;meta charset=&quot;UTF-8&quot;&amp;gt;
    &amp;lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1&quot;&amp;gt;
    &amp;lt;!-- &amp;lt;link href=&quot;css/style.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot;&amp;gt; --&amp;gt;
  &amp;lt;/head&amp;gt;
  &amp;lt;body&amp;gt;
    &amp;lt;div id=&quot;app&quot;&amp;gt;
      &amp;lt;h2&amp;gt;Works!&amp;lt;/h2&amp;gt;
    &amp;lt;/div&amp;gt;
    &amp;lt;script src=&quot;js/compiled/app.js&quot; type=&quot;text/javascript&quot;&amp;gt;&amp;lt;/script&amp;gt;
  &amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This is my project structure:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;.
├── project.clj
├── resources
│   └── public
│       ├── css
│       ├── index.html
│       └── js
│           └── compiled
│               ├── app.js
│               └── out
│                   ├── cljs
│                   ├── cljs_deps.js
│                   ├── cljsc_opts.edn
│                   ├── cljsjs
│                   ├── clojure
│                   ├── figwheel
│                   ├── goog
│                   ├── process
│                   ├── reagent
│                   └── ws_poc
├── src
    └── ws_poc
        ├── core.cljs
        └── server
           └── core.clj
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And finally my &lt;code&gt;project.clj&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(defproject ws-poc &quot;0.1.0-SNAPSHOT&quot;
      :description &quot;FIXME: write description&quot;
      :url &quot;http://example.com/FIXME&quot;
      :license {:name &quot;Eclipse Public License&quot;
                :url &quot;http://www.eclipse.org/legal/epl-v10.html&quot;}
      :dependencies [[org.clojure/clojure &quot;1.8.0&quot;]
                     [org.clojure/clojurescript &quot;1.10.764&quot;]
                     [environ &quot;1.2.0&quot;]
                     [reagent &quot;1.0.0-alpha1&quot;]]

      :plugins [[lein-figwheel &quot;0.5.19&quot;]
                [lein-cljsbuild &quot;1.1.8&quot;]
                [lein-environ &quot;1.2.0&quot;]]

      :source-paths [&quot;src&quot;]

      :clean-targets ^{:protect false} [&quot;resources/public/js/compiled&quot; &quot;target&quot;]

      :main ^:skip-aot ws-poc.server.core

      ; :target-path &quot;target/%s&quot;
      :profiles {:dev {:env {:dev? &quot;true&quot;}
                       :cljsbuild {:builds
                                   [{:id &quot;dev&quot;
                                     :source-paths [&quot;src&quot;]
                                     :figwheel {}
                                     :compiler {:main ws-poc.core
                                                :asset-path &quot;js/compiled/out&quot;
                                                :output-to &quot;resources/public/js/compiled/app.js&quot;
                                                :output-dir &quot;resources/public/js/compiled/out&quot;
                                                :source-map-timestamp true}}]}}}

      :figwheel {:css-dirs [&quot;resources/public/css&quot;]})
&lt;/code&gt;&lt;/pre&gt;
</description>
<category>ClojureScript</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/9311/reagent-undefined-in-clj-cljs-setup</guid>
<pubDate>Tue, 19 May 2020 08:46:47 +0000</pubDate>
</item>
<item>
<title>No credentials found: deploying Clojars using a Github Workflow (Actions).</title>
<link>https://ask.clojure.org/index.php/9049/credentials-found-deploying-clojars-github-workflow-actions</link>
<description>&lt;p&gt;For some reason that I can't find, it's impossible for me to deploy Clojars using Github Actions. This is my script where I perform the action.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;  - name: Deploy clojars
      run: |
        mkdir ~/.lein
        echo '{:user {} :auth {:repository-auth{#&quot;clojars&quot; {:username &quot;${{ secrets.CLOJARS_USERNAME }}&quot; :password &quot;${{ secrets.CLOJARS_PASSWORD }}&quot; :sign-releases false }}}}' &amp;gt; ~/.lein/profiles.clj
        lein deploy clojars
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;He's always telling me he can't find the credentials.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;No credentials found for clojars
    See `lein help deploying` for how to configure credentials to avoid prompts.
    Username: LEIN IS UNABLE TO TURN OFF ECHOING, SO THE PASSWORD IS PRINTED TO THE CONSOLE
    Password: Created /home/runner/work/tadam-core/tadam-core/target/tadam-core-0.3.0.jar
    Wrote /home/runner/work/tadam-core/tadam-core/pom.xml
    Need to sign 2 files with GPG
    [1/2] Signing /home/runner/work/tadam-core/tadam-core/target/tadam-core-0.3.0.jar with GPG
    gpg: directory '/home/runner/.gnupg' created
    gpg: keybox '/home/runner/.gnupg/pubring.kbx' created
    gpg: no default secret key: No secret key
    gpg: signing failed: No secret key
    Could not sign /home/runner/work/tadam-core/tadam-core/target/tadam-core-0.3.0.jar
    gpg: directory '/home/runner/.gnupg' created
    gpg: keybox '/home/runner/.gnupg/pubring.kbx' created
    gpg: no default secret key: No secret key
    gpg: signing failed: No secret key
    
    
    See `lein help gpg` for how to set up gpg.
    If you don't expect people to need to verify the authorship of your jar, you
    can add `:sign-releases false` to the relevant `:deploy-repositories` entry.
    ##[error]Process completed with exit code 1.
&lt;/code&gt;&lt;/pre&gt;
</description>
<category>Tools</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/9049/credentials-found-deploying-clojars-github-workflow-actions</guid>
<pubDate>Tue, 21 Jan 2020 15:43:33 +0000</pubDate>
</item>
<item>
<title>Equivalent of Leiningen's :managed-dependencies in deps.edn?</title>
<link>https://ask.clojure.org/index.php/8440/equivalent-of-leiningens-managed-dependencies-in-deps-edn</link>
<description>&lt;p&gt;Leiningen has a feature called &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/technomancy/leiningen/blob/master/doc/MANAGED_DEPS.md&quot;&gt;Managed Dependencies&lt;/a&gt;. This lets  you set a common version for a transitive dependency to be used instead of relying on versions provided by your dependencies. This is useful when you want to specify a version of a library without actually adding a dependency on it. It has a very similar effect (I think) as adding the dependency directly to your Leiningen &lt;code&gt;:dependencies&lt;/code&gt;, but communicates the intention better.&lt;/p&gt;
&lt;p&gt;Is there something similar like this in &lt;code&gt;deps.edn&lt;/code&gt;? A way to specify a version resolution for a dependency without adding it directly to &lt;code&gt;:deps&lt;/code&gt;?&lt;/p&gt;
</description>
<category>tools.deps</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/8440/equivalent-of-leiningens-managed-dependencies-in-deps-edn</guid>
<pubDate>Thu, 22 Aug 2019 21:42:05 +0000</pubDate>
</item>
</channel>
</rss>