Couldn't get datomic client artifact - clojure

I'm following the on-prem "getting started" guide to, well, "get started" on datomic, with the end goal of migrating a side project app to ions later.
When starting my repl I get Could not find artifact com.datomic:client-pro:jar:0.9.5786 in central (https://repo1.maven.org/maven2/).
Here's my ~/.m2/settings.xml file:
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
https://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<id>my.datomic.com</id>
<username>my-email</username>
<password>my-key</password>
</server>
</servers>
</settings>
And my deps.edn file:
{:deps
{some-other-libs {:mvn/version "blah"}
com.datomic/client-pro {:mvn/version "0.9.5786"}
}
:mvn/repos
{"my.datomic.com" {:url "https://my.datomic.com/repo"}
}
}
For some reason I can't see what I did wrong, "it" doesn't seem to try fetching the dependency from "my.datomic.com" but rather gets stuck after not finding it on maven central.
I'm using Clojure 1.9.0. Can anyone help?

I mixed-up the dependency versions between the getting-started and the dependency example specified in the my.datomic.com/account page.
The correct version should be 0.8.28:
{:deps
{
com.datomic/client-pro {:mvn/version "0.8.28"}
}
:mvn/repos
{"my.datomic.com" {:url "https://my.datomic.com/repo"}
}
}

I have not yet tried the on-prem version of Datomic, but if you just want to get started you can clone the following repo:
https://github.com/cloojure/tupelo-datomic
which includes a (curated) copy of datomic-free

Related

Clojure with Datomic (lein-datomic) in Windows

I have set up Datomic database up and running within a Clojure project. It is working fine when running my unit tests against it BUT:
Now I want to use it for real I have:
downloaded datomic-free-0.9.5697
configured my clojure project with lein-datomic 0.2.0 and its instructions.
updated profiles.clj to be:
{:user
{
:java-cmd "C:\\Program Files\\Java\\jdk1.8.0_152\\bin\\java.exe"
:plugins [[lein-datomic "0.2.0"]]
:datomic {:install-location "C:\\Users\\myusername\\.lein\\bin\\datomic-free-0.9.5697"}}}
}
}
but if I now run 'lein datomic start' I get an error:
java.io.IOException: Cannot run program "bin/transactor" (in directory "C:\Users\myusername\.lein\bin\datomic-free-0.9.5697"): CreateProcess error=2, The system cannot find the file specified
at java.lang.ProcessBuilder.start (ProcessBuilder.java:1048)
What is wrong with profiles.clj install-location? Is it not working, because the fact I am using Windows. Is there issue with path format?
"bin/transactor" is actually bin folder where transactor and transactor.cmd file exists.

why is this lein new template is failing

I just started with clojure web development, but, got stuck on step 1.
D:\cloj\work>lein new luminus guestbook +h2
Could not find artifact luminus:lein-template:jar:? in central
(https://repo1.maven.org/maven2/)
Could not find artifact luminus:lein-template:jar:? 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.
I can see the template in clojars at
https://clojars.org/repo/luminus/lein-template/
I am not behind a proxy.
my .lein/profiles.clj has the following content
{:user
{
:java-cmd "C:\Program Files\Java\jdk1.8.0_65\bin\java.exe"
:plugins [
[lein-ancient "0.6.10"]
[luminus/lein-template ​"2.9.10.74"​]
]
}
}
what am I missing !
thank you
I was facing the same issue when reading the Web development With Clojure ebook. The problem was that I copy pasted the profiles.clj configuration from the ebook, which resulted in some invisible characters getting included that messed up the configuration. I verified this with a hex viewer.
The solution is to type the configuration manually or copy paste from here if you're lazy :)
{:user
{:plugins [
[luminus/lein-template "2.9.10.74"]
]
}
}
Of course you can just omit this too, but then you'll be using the latest version which might have some changes from when the book was written.

Using a mirror of Clojars from Leiningen

The following Wiki page describes a straightforward way of setting up Leiningen to use a mirror of Clojars.org: https://github.com/clojars/clojars-web/wiki/Mirrors
Based on this, I have put the following as my ~/.lein/profiles.clj:
{:user {:mirrors
{#"clojars" {:name "clojars mirror"
:url "https://clojars-mirror.tcrawley.org/repo/"}}}}
However, even with this profiles.clj, I can still see in e.g. Wireshark that lein is trying to connect to clojars.org instead of clojars-mirror.tcrawley.org. What setting am I missing?
My Leiningen version is
Leiningen 2.5.3 on Java 1.7.0_91 OpenJDK 64-Bit Server VM
I couldn't get a mirror working by modifying profile.clj either.
However I was able to get it working for a specific project.clj by adding this within defproject
:mirrors {#"clojars" {:name "Clojar Mirror"
:url "https://clojars-mirror.tcrawley.org/repo/"
:repo-manager true}}
Notes:
This came from the official Leiningen sample project.clj:
https://github.com/technomancy/leiningen/blob/master/sample.project.clj
I tried following the below for global setting in profile.clj (the syntax is somewhat different from yours) but had no luck:
https://github.com/technomancy/leiningen/issues/271#issuecomment-21108691
https://stackoverflow.com/a/17697119/617320

Failing to connect to compojure-app with LightTable

I just ran "lein new compojure-app guestbook" following the book "Web Development with Clojure". In one step the book is connecting to my Clojure project with light table. However when I try this I get the following error that makes no sense to me.
Here is the error I'm getting
Your Error
For the search engines, here is a copy of the pertinent part of your error:
Error loading lighttable.nrepl.handler: java.lang.RuntimeException: Unable to resolve var: reader/*alias-map* in this context
The Cause
Lighttable has upgraded to using a newer tools.reader.
I found two resources:
An applicable github issue that you might find helpful.
A forum thread covering the question (mentioned in the github issue above).
The Summarized Solution
Several people have solved this by simply running lein clean in their project directory.
If lein clean does not solve it for you, then here is the extended solution from the forum:
In project.clj. Replace
[compojure “1.1.6”]
with
[compojure “1.1.6” :exclusions [org.clojure/tools.reader]]
and add to the :dependencies list
[org.clojure/tools.reader “0.7.10”]
The reason seems to be that LightTable expects this version of
tools.reader, but Compojure brings in version 0.7.3
After employing this solution, you may wish to run lein clean again.

How to fix backtrace in clojure & slime

I'm a clojure noob trying to get emacs & slime set up. There doesn't seem to be one true way to do this, so I've followed a few blog posts and the swank-clojure and leiningen READMEs.
Mostly it works. My problem is that if I try to select restart 0 [QUIT] from a backtrace, I get
'error in process filter: Wrong number of arguments: nil, 0'
(I also see a warning on 'M-x slime-connect' about slime and swank being mismatched versions, but Googling suggests this is expected).
This is Debian Lenny. I got slime via 'git clone git://git.boinkor.net/slime.git'.
Clojure and clojure-contrib are 1.2.0, and swank-clojure is 1.2.1.
Anyone seen this? Alternatively, is there an up-to-date list of compatible versions of all the pieces? Many thanks.
Edit:
Looks like it is probably this issue. I followed the same blog post as the OP in that thread.
Edit:
Yes. Getting slime and slime-repl packages using ELPA fixed it.
Don't get slime via git, but use ELPA. See the links in my edits to the question.
the clojure ecosystem has changed a lot over this last year so many of the most linked tutorials sort of do things the hard way. you dont really need to build clojure/contrib and install it anymore. both Maven2 and leinengen do this ver well for you.
you may be able to get up and clojureing just by installing lein (from the tutorial) and then making a new project. this is enough to keep me happy even on my larger projects. you dont really need to install clojure system wide.
from a (ubuntu-10.10) system that has never seen clojure before i run:
dev:~$ lein new foo
Created new project in: foo
dev:~$ cd foo
dev:~/foo$ ls
project.clj README src test
dev:~/foo$ lein repl
Downloading: org/clojure/clojure/1.2.0/clojure-1.2.0.pom from central
Downloading: org/clojure/clojure-contrib/1.2.0/clojure-contrib-1.2.0.pom from central
Downloading: org/clojure/clojure-contrib/1.2.0/clojure-contrib-1.2.0.pom from clojure
Transferring 4K from clojure
Downloading: org/clojure/clojure/1.2.0/clojure-1.2.0.jar from central
Downloading: org/clojure/clojure-contrib/1.2.0/clojure-contrib-1.2.0.jar from central
Downloading: org/clojure/clojure-contrib/1.2.0/clojure-contrib-1.2.0.jar from clojure
Transferring 466K from clojure
Copying 2 files to /home/arthur/foo/lib
"REPL started; server listening on localhost:20092."
user=> (+ 1 2 3)
and thats all you really need. have fun :) (of course there is a LOT more to the clojure ecosystem though there is no need to really rush into it)
ps: add swank-clojure as a dev dependency and run lein swank and then slime-connect from within emacs
ps: I hit 'q' to exit the backtraces.
Here's an update for google: things have changed since the previous answers and the correct way to start swank/slime is now via the clojure-jack-in command in recent versions of clojure-mode, which uses the corresponding lein jack-in command in recent versions of swank-clojure. Using clojure-jack-in, all the Emacs dependencies other than clojure-mode are automatically installed for you. DO NOT install slime.el or slime-repl.el manually, via ELPA or via git.