Leiningen cannot find clj-native dependency in lastest Overtone 0.8.0-SNAPSHOT

103 views
Skip to first unread message

Joel J.

unread,
Nov 14, 2012, 10:58:08 AM11/14/12
to over...@googlegroups.com
Hi!  I just pulled the latest version of Overtone from the github repository and when I try to do "lein2 repl" I'm getting an error that it cannot find the artifact clj-native 0.9.3-SNAPSHOT.  It looks like that's the current version of clj-native up on github, but apparently my Leiningen isn't finding a jar for it in any of the repositories I'm searching.  Is there somewhere else I should be searching, or do I need to clone clj-native and jar it up and add it to my local repository myself, or do I just need to hold tight until they get clj-native into a repository?  (I'm guessing 'no' since I believe Overtone has been using clj-native for quite some time, and I've never seen this problem before...)

Thanks!
Joel

Sam Aaron

unread,
Nov 14, 2012, 11:38:08 AM11/14/12
to over...@googlegroups.com
Hi Joel,

it looks like clj-native 0.9.3-SNAPSHOT hasn't yet been pushed to Clojars.

Jeff, did you build that version from github?
Markus, could you push a new version to Clojars?

Sam

---
http://sam.aaron.name

Joel J.

unread,
Nov 14, 2012, 12:01:58 PM11/14/12
to over...@googlegroups.com
it looks like clj-native 0.9.3-SNAPSHOT hasn't yet been pushed to Clojars.

Okay, thanks Sam.

On a related note, is it possible to use other projects on your computer (that aren't packaged up as jars) as dependencies?  In other words, would it be possible for me to clone the latest clj-native from github and then somehow tell Leiningen "Hey, when a project depends on this version of clj-native, here it is"?  (I thought I saw something about this on the list awhile back, but I can't find it and I might have misunderstood what was actually being discussed...)

--Joel

Jeff Rose

unread,
Nov 14, 2012, 12:24:08 PM11/14/12
to over...@googlegroups.com
Oh right, I forgot about that. Hopefully Markus can push a new jar.

In the meantime, you can use any project from source by doing:

lein install

in the source directory. It will put it into the ~/.m2 maven repository just as if you had gotten it through lein deps.

-Jeff

Sam Aaron

unread,
Nov 14, 2012, 1:10:05 PM11/14/12
to over...@googlegroups.com

On 14 Nov 2012, at 18:01, Joel J. <tce...@gmail.com> wrote:
>
> On a related note, is it possible to use other projects on your computer (that aren't packaged up as jars) as dependencies? In other words, would it be possible for me to clone the latest clj-native from github and then somehow tell Leiningen "Hey, when a project depends on this version of clj-native, here it is"? (I thought I saw something about this on the list awhile back, but I can't find it and I might have misunderstood what was actually being discussed...)

Yep, that's totally possible. Options are:

* Use the approach Jeff mentions (lein install in a checkout of clj-native)
* Create your own local maven repository and point to that.
* Use lein's checkout functionality - create a directory called checkouts in the root directory of your project, and within there put a fresh pull of clj-native, so you should have your-project-root/checkouts/clj-native and lein will prefer the checkouts dir over any jar.

Sam

---
http://sam.aaron.name

Joel J.

unread,
Nov 15, 2012, 12:43:29 AM11/15/12
to over...@googlegroups.com
Great, that did the trick, thanks (ended up going with lein install, since adding the checkouts and putting clj-native in it didn't seem to work.  I got the vauge impression that there might be additional configuration of the project.clj file of the dependent project (in this case, Overtone) but I wasn't able to find anything concrete about syntax or anything--regardless, it is working now and the scope looks great!)

--Joel

Sam Aaron

unread,
Nov 15, 2012, 1:53:49 AM11/15/12
to over...@googlegroups.com

On 15 Nov 2012, at 06:43, Joel J. <tce...@gmail.com> wrote:

> since adding the checkouts and putting clj-native in it didn't seem to work.

Are you using the latest lein preview (2.0.0-preview10)?

Sam

---
http://sam.aaron.name

Joel J.

unread,
Nov 15, 2012, 12:39:33 PM11/15/12
to over...@googlegroups.com
> since adding the checkouts and putting clj-native in it didn't seem to work.

Are you using the latest lein preview (2.0.0-preview10)?

Ah, no, I'd been using preview6.  I just upgraded to preview10 and removed clj-native from my .m2/repositories/ folder, then created the checkouts folder under my overtone project and cloned clj-native into it.  Still no luck (might be because I'm on Windows--will try to check in Linux when I get home this evening):

C:\Dev\projects\clojure_explore\overtone>ls checkouts/clj-native
README.md  epl-v10.html  project.clj  src  test

C:\Dev\projects\clojure_explore\overtone>less checkouts/clj-native/project.clj
(defproject clj-native "0.9.3-SNAPSHOT"
  :description "Simplify usage of native libs from Clojure. Uses JNA."
  :dependencies [[org.clojure/clojure "1.4.0"]
                 [net.java.dev.jna/jna "3.4.0"]])

C:\Dev\projects\clojure_explore\overtone>lein2 repl
Could not find artifact clj-native:clj-native:pom:0.9.3-SNAPSHOT in central (http://repo1.maven.org/maven2)
Could not find artifact clj-native:clj-native:pom:0.9.3-SNAPSHOT in clojars (https://clojars.org/repo/)
Could not find artifact clj-native:clj-native:jar:0.9.3-SNAPSHOT in central (http://repo1.maven.org/maven2)
Could not find artifact clj-native:clj-native:jar:0.9.3-SNAPSHOT in clojars (https://clojars.org/repo/)
Check :dependencies and :repositories for typos.
It's possible the specified jar is not in any repository.
If so, see "Free-floating Jars" under http://j.mp/repeatability
Exception in thread "Thread-1" clojure.lang.ExceptionInfo: Could not resolve dependencies {:exit-code 1}
[stacktrace snipped]


Sam Aaron

unread,
Nov 15, 2012, 1:01:04 PM11/15/12
to over...@googlegroups.com
Ah, I see the issue,

you've still got clj-native 0.9.3-SNAPSHOT in your project.clj (or in the transitive deps of your own project which uses Overtone 0.8.0-SNAPSHOT).

The solution in this case is to either lein install as Jeff suggested, or modify the overtone project.clj to point to 0.9.2-SNAPSHOT and then place the clj-native checkout.

Sam

---
http://sam.aaron.name

Joel J.

unread,
Nov 15, 2012, 1:44:59 PM11/15/12
to over...@googlegroups.com

you've still got clj-native 0.9.3-SNAPSHOT in your project.clj (or in the transitive deps of your own project which uses Overtone 0.8.0-SNAPSHOT).

Correct; I'm just trying to run a REPL with the latest version of Overtone.  At this point (since I did get it working previously with lein install) I'm mostly just trying to understand how checkouts work--feel free to tell me that I should take this to #clojure instead ;-)

The solution in this case is to either lein install as Jeff suggested, or modify the overtone project.clj to point to 0.9.2-SNAPSHOT and then place the clj-native checkout.

On the surface, that doesn't make a lot of sense to me since I have the 0.9.3-SNAPSHOT of clj-native in my checkouts folder; my confusion is "Why would leiningen be able to see the 0.9.2-SNAPSHOT when it can't see the 0.9.3-SNAPSHOT that is already there?"  Does the project in question have to have an entry in a repository that leiningen knows about (e.g. Clojars) in order to be used in checkouts?

--Joel

Sam Aaron

unread,
Nov 15, 2012, 1:52:55 PM11/15/12
to over...@googlegroups.com

On 15 Nov 2012, at 19:44, Joel J. <tce...@gmail.com> wrote:

>
> On the surface, that doesn't make a lot of sense to me since I have the 0.9.3-SNAPSHOT of clj-native in my checkouts folder; my confusion is "Why would leiningen be able to see the 0.9.2-SNAPSHOT when it can't see the 0.9.3-SNAPSHOT that is already there?"

The question is best answered when you separate lein into the Clojure part and the Maven part. It's the maven part that's complaining in your case - it's not able to see 0.9.3-SNAPSHOT because it's not available in a known maven repository. The checkouts functionality is a Clojure extension to this - it works by adding 'checked out' projects *before* the jars in the JVM classpath - therefore the JVM sees the checkouts before the jar.

Does this help?

Sam

---
http://sam.aaron.name

Joel J.

unread,
Nov 15, 2012, 2:58:35 PM11/15/12
to over...@googlegroups.com
Thanks Sam, yes, that makes a bit more sense--and thanks again for bringing it to my attention in the first place ^_^

--Joel
Reply all
Reply to author
Forward
0 new messages