-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathproject.clj
80 lines (67 loc) · 3.43 KB
/
project.clj
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
(defproject ring-sample "1.0.0-SNAPSHOT"
:description "A simple well-annotated ring application to demonstrate some of the features of Clojure."
:dependencies [[org.clojure/clojure "1.4.0"]
;; Ring provides support for handing web requests.
;; It is similar to Ruby's Rack and Python's WSGI.
;; It can run inside of Tomcat, or by itself.
;; The Jetty adapter let us run as a stand-alone
;; application with an embeded web server.
[ring/ring-core "1.1.0"]
[ring/ring-jetty-adapter "1.1.0"]
;; Compojure lets us define RESTful routes.
[compojure "1.1.0"]
;; Korma helps us generate SQL... but we're not using it.
;; [korma "0.3.0-beta9"]
;; The is the de facto Clojure logging library. It uses
;; log4j under the hood, so we'll include that below.
;; Leiningen can usually figure out these dependencies,
;; but we're going to add an entry for log4j because we
;; want to tell Leiningen to exclude the pieces of it
;; we don't need.
[org.clojure/tools.logging "0.2.3"]
;; We'll just go with the standard Clojure JDBC wrapper,
;; which is quite handy.
[org.clojure/java.jdbc "0.2.0"]
;; The following libraries are pure Java.
;; Note that we exclude some heavyweight parts of
;; log4j that we don't need in our application.
[org.xerial/sqlite-jdbc "3.7.2"]
[cheshire "4.0.0"]
[joda-time "2.0"]
[log4j "1.2.16" :exclusions [javax.mail/mail
javax.jms/jms
com.sun.jdmk/jmxtools
com.sun.jmx/jmxri]]]
;; ring-devel will be loaded during development.
;; It allows us to edit code while the app is running,
;; and have the changes picked up immediately.
:dev-dependencies [[ring/ring-devel "1.1.0"]]
;; These are leiningen plugins used during development.
;; lein-ring enables us to fire up our app as a web server.
;; It also can package the application as a war file or as
;; an uberwar, which will run as a stand-alone web server + app.
;; lein-swank lets us develop interactively using emacs.
:plugins [[lein-ring "0.6.6"]
[lein-swank "1.4.4"]]
;; This tells ring where to find the main entry-point
;; of the application.
:ring {:handler ring-sample.core/app}
;; If we want to compile our project into a stand-alone application,
;; we can define a Java main method. This tells leiningen where
;; that method is.
:main ring-sample.core
;; leiningen knows where to find useful repositories for
;; downloading jar files. We sometimes have to tell it about
;; additional repos to get obscure jars.
;; :repositories {
;; "xerial" "http://www.xerial.org/maven/repository/"
;; "some-other-repo" "http://repo.sample.kom/maven/"}
;; We can also tell leiningen what options to pass to the
;; JVM when it starts our application.
:jvm-opts ["-server"
"-Xms32M"
"-Xmx256M"
"-XX:NewRatio=5"
"-XX:+UseConcMarkSweepGC"
"-XX:+UseParNewGC"
"-XX:MaxPermSize=64m"])