1

I want to change something in incanter, so I created a fork on github and a clone of it on my laptop. Now, when I try to run tests with lein test I get these errors:

/Users/me/work/incanter$ lein test
Could not find artifact incanter:incanter-core:jar:1.5.8-SNAPSHOT in clojars (https://clojars.org/repo/)
Could not find artifact incanter:incanter-io:jar:1.5.8-SNAPSHOT in clojars (https://clojars.org/repo/)
Could not find artifact incanter:incanter-charts:jar:1.5.8-SNAPSHOT in clojars (https://clojars.org/repo/)
Could not find artifact incanter:incanter-mongodb:jar:1.5.8-SNAPSHOT in clojars (https://clojars.org/repo/)
Could not find artifact incanter:incanter-pdf:jar:1.5.8-SNAPSHOT in clojars (https://clojars.org/repo/)
Could not find artifact incanter:incanter-svg:jar:1.5.8-SNAPSHOT in clojars (https://clojars.org/repo/)
Could not find artifact incanter:incanter-latex:jar:1.5.8-SNAPSHOT in clojars (https://clojars.org/repo/)
Could not find artifact incanter:incanter-excel:jar:1.5.8-SNAPSHOT in clojars (https://clojars.org/repo/)
Could not find artifact incanter:incanter-sql:jar:1.5.8-SNAPSHOT in clojars (https://clojars.org/repo/)
Could not find artifact incanter:incanter-zoo:jar:1.5.8-SNAPSHOT in clojars (https://clojars.org/repo/)
This could be due to a typo in :dependencies or network issues.
If you are behind a proxy, try setting the 'http_proxy' environment variable.
/Users/me/work/incanter$

I have not changed anything in the project.clj yet, here it is:

(defproject incanter "1.5.8-SNAPSHOT"
  :description "Incanter is a Clojure-based, R-like statistical programming and data visualization environment."
  :url "http://incanter.org/"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :scm {:name "git" :url "https://github.com/incanter/incanter"}
  :min-lein-version "2.0.0"
  :dependencies [[incanter/incanter-core "1.5.8-SNAPSHOT"]
                 [incanter/incanter-io "1.5.8-SNAPSHOT"]
                 [incanter/incanter-charts "1.5.8-SNAPSHOT"]
                 [incanter/incanter-mongodb "1.5.8-SNAPSHOT"]
                 [incanter/incanter-pdf "1.5.8-SNAPSHOT"]
                 [incanter/incanter-svg "1.5.8-SNAPSHOT"]
                 [incanter/incanter-latex "1.5.8-SNAPSHOT"]
                 [incanter/incanter-excel "1.5.8-SNAPSHOT"]
                 [incanter/incanter-sql "1.5.8-SNAPSHOT"]
                 [incanter/incanter-zoo "1.5.8-SNAPSHOT"]
                 [org.clojure/clojure "1.5.1"]
                 ]
  :profiles {:dev {:resource-paths ["data"]}
             :debug {:debug true}
             :uberjar {:aot :all
                       :main incanter.main
                       :dependencies [[reply "0.3.0" :exclusions [org.clojure/clojure]]
                                      [swingrepl "1.3.0"
                                       :exclusions [org.clojure/clojure org.clojure/clojure-contrib]]
                                      ]
                       }
             }  
  :repl-options {:init-ns incanter.irepl
                 :resource-paths ["data"]
                 :init (do
                         (set! *print-length* 500)
                         (use 'clojure.repl))
                 }
  :jvm-opts ["-Xmx1g" "-Djsse.enableSNIExtension=false"
             ~(str "-Dincanter.home=" (System/getProperty "user.dir"))]
  )

Any help will be greatly appreciated.

piokuc
  • 25,594
  • 11
  • 72
  • 102
  • you want to use that libs from your local, I mean from your system? The thing is you don't have those deps in your ~/.m2(maven) you get that exception and leiningen tries to search in clojars. – Ertuğrul Çetin Aug 19 '17 at 13:05
  • Sorry, I'm new to Clojure and not really familiar with maven. Could you please give details of what needs to be done to get the deps in my local maven directory? – piokuc Aug 19 '17 at 13:08
  • maven is build tool that leiningen uses underneath, I've answered your question if it is not clear I can edit it in detail. – Ertuğrul Çetin Aug 19 '17 at 13:11
  • Did you go `lein install` from the command line at the project root of your Incanter project? That's the usual way, although usually there is one jar per project. But worth a try. Also you should manually look in your .m2 directory to see what's there. – Chris Murphy Aug 19 '17 at 13:24
  • I recommend to use `develop` branch if you want to submit patches to Incanter. And it supports `sub` & `modules` plugins, so you can do `lein sub test` to perform `test` task for all modules. – Alex Ott Aug 20 '17 at 09:01
  • @AlexOtt many thanks for the tips. – piokuc Aug 20 '17 at 10:09

2 Answers2

3

I took a look at the project. You must build any projects under /modules so that the snapshot-version 1.5.8-SNAPSHOT will be builded on your local .m2/

cd modules
cd incanter-core
lein install
...

Then I think it should work. Alternative you can reduce in the dependencies to 1.5.7.

Minh Tuan Nguyen
  • 1,026
  • 8
  • 13
1

You can use this approach:

Create jars of those projects(lein uberjar)

Then use command for each your jar:

mvn install:install-file \
 -Dfile=maven_repository/my-project.jar \ ;;path to your jar(this is example)
 -DgroupId= incanter \
 -DartifactId= incanter \
 -Dversion=0.1.0 \
 -Dpackaging=jar \
 -DgeneratePom=true

Then add deps to your project.clj and refresh leiningen:

[incanter/incanter "0.1.0"]
[groupId/artifactId "your-version"]
...
Ertuğrul Çetin
  • 5,131
  • 5
  • 37
  • 76
  • Many thanks. Unfortunately, when I run `lein uberjar` I get errors like `Could not find artifact incanter:incanter-core:jar:1.5.8-SNAPSHOT in clojars (https://clojars.org/repo/)` and eventually it says: `Uberjar aborting because jar failed: Could not resolve dependencies` – piokuc Aug 19 '17 at 13:13
  • Note, the dependencies are submodules of incanter. – piokuc Aug 19 '17 at 13:17
  • you can go to https://clojars.org/incanter/incanter-core and search each modules latest versions and update according to that and try to run lein test again? let me know how it goes – Ertuğrul Çetin Aug 19 '17 at 13:19
  • it seems like those versions don't exist anymore – Ertuğrul Çetin Aug 19 '17 at 13:20
  • Thing is, I want to change one of the modules (maybe more), so ideally I'd like lein to build all the modules from the source in the incanter repo (my local clone) and use them, rather than any other version from clojars. – piokuc Aug 19 '17 at 13:22
  • then you need to download each module(project) and do what I just answered you need the jars. – Ertuğrul Çetin Aug 19 '17 at 13:24