我的问题是通用的,不特定于JFreeChart。我从根本上不明白如何弥合一个示例所使用的某个特定包之间的差距,并通过lein使该包对我可用。希望有人能以适用于其他软件包的方式回答。
请参考此链接:https://github.com/markmfredrickson/dejcartes/blob/master/Readme.txt。我的project.clj文件像这样(为了发布此帖子,注释掉了最后2行中的一个)。
(defproject monty "1.0.0-SNAPSHOT"
:description "Monty Game Challenge"
:dependencies [[org.clojure/clojure "1.2.1"]
[org.clojure/clojure-contrib "1.2.0"]
;[org.jfree/chart "1.0.13"]])
[com.markmfredrickson/dejcartes "1.0.0"]])
I see
(import '(org.jfree.chart chartframe))
used in the Dejcartes readme.txt, so I think this means I need the .jar file for JFreeChart, right?I put
[org.jfree/chart "1.0.13"]
in my project.clj butlein deps
complains about it as follows:C:\Users\me\code\Clojure\monty>lein deps Downloading: org/jfree/chart/1.0.13/chart-1.0.13.pom from central Downloading: org/jfree/chart/1.0.13/chart-1.0.13.pom from clojure Downloading: org/jfree/chart/1.0.13/chart-1.0.13.pom from clojars Downloading: org/jfree/chart/1.0.13/chart-1.0.13.pom from central Downloading: org/jfree/chart/1.0.13/chart-1.0.13.jar from central Downloading: org/jfree/chart/1.0.13/chart-1.0.13.jar from clojure Downloading: org/jfree/chart/1.0.13/chart-1.0.13.jar from clojars Downloading: org/jfree/chart/1.0.13/chart-1.0.13.jar from central An error has occurred while processing the Maven artifact tasks. Diagnosis: Unable to resolve artifact: Missing: ---------- 1) org.jfree:chart:jar:1.0.13 Try downloading the file manually from the project website.
I think I need to download the .jar file directly but once I have the .jar file how do I coax lein to put it in the classpath for me so I can lein swank it using emacs, etc.?
The Dejcartes example uses
(require '[com.markmfredrickson.dejcartes :as chart])
so I put[com.markmfredrickson/dejcartes "1.0.0"]
in my project.clj. This appears to start downloading some stuff when I runlein deps
but then it chokes in the same way:C:\Users\me\code\Clojure\monty>lein deps Downloading: com/markmfredrickson/dejcartes/1.0.0/dejcartes-1.0.0.pom from central Downloading: com/markmfredrickson/dejcartes/1.0.0/dejcartes-1.0.0.pom from clojure Downloading: com/markmfredrickson/dejcartes/1.0.0/dejcartes-1.0.0.pom from clojars Downloading: com/markmfredrickson/dejcartes/1.0.0/dejcartes-1.0.0.pom from central Downloading: com/markmfredrickson/dejcartes/1.0.0/dejcartes-1.0.0.jar from central Downloading: com/markmfredrickson/dejcartes/1.0.0/dejcartes-1.0.0.jar from clojure Downloading: com/markmfredrickson/dejcartes/1.0.0/dejcartes-1.0.0.jar from clojars Downloading: com/markmfredrickson/dejcartes/1.0.0/dejcartes-1.0.0.jar from central An error has occurred while processing the Maven artifact tasks. Diagnosis: Unable to resolve artifact: Missing: ---------- 1) com.markmfredrickson:dejcartes:jar:1.0.0 Try downloading the file manually from the project website.
One of the repositories it is allegedly downloading from (clojars) doesn't even have Dejcartes shown in the big list. How do I get Lein to download Dejcartes?
Finally, given that I want to start using some package, how do I get lein to automatically find the latest version? I haven't seen anything about this and all the project.clj examples seem to hard-code the version, eg
"1.0.2"
etc.