Skip to content
This repository
Newer
Older
100644 262 lines (257 sloc) 14.981 kb
915e61a8 »
2010-06-05 Add sample.project.clj showing all honored project keys.
1 ;; This is an annotated example of the options that may be set in a
2 ;; project.clj file. It is a fairly contrived example in order to
3 ;; cover all options exhaustively; it shouldn't be considered a
19b44647 »
2010-12-24 Rework some of sample.project.clj.
4 ;; representative configuration. For a more detailed explanation of
5 ;; some of the terms run "lein help tutorial".
915e61a8 »
2010-06-05 Add sample.project.clj showing all honored project keys.
6
14f566bd »
2012-05-23 Spin FAQ off into its own page.
7 ;; These options apply to Leiningen 2.x. See the 1.x branch for older versions:
8 ;; https://github.com/technomancy/leiningen/blob/1.x/sample.project.clj
9
915e61a8 »
2010-06-05 Add sample.project.clj showing all honored project keys.
10 ;; The project is named "sample", and its group-id is "org.example".
11 (defproject org.example/sample "1.0.0-SNAPSHOT" ; version "1.0.0-SNAPSHOT"
3e7f75ee »
2010-06-24 Mention unquote in sample.project.clj
12 ;; Beyond this point you may prepend a form with unquote, or ~, to eval it.
13
19b44647 »
2010-12-24 Rework some of sample.project.clj.
14 ;; The descrption text is searchable from repositories like Clojars.
915e61a8 »
2010-06-05 Add sample.project.clj showing all honored project keys.
15 :description "A sample project"
16 :url "http://example.org/sample-clojure-project"
3b445493 » michalmarczyk
2010-06-17 Documented :mailing-list and :license in sample.project.clj.
17 ;; The mailing list of the project. If the project has multiple mailing
18 ;; lists, use the :mailing-lists key (bound to a seq of mailing list
19 ;; descriptions as below).
20 :mailing-list {:name "sample mailing list"
21 :archive "http://example.org/sample-mailing-list-archives"
c43ee751 »
2010-07-12 Trim long lines.
22 :other-archives ["http://example.org/sample-list-archive2"
23 "http://example.org/sample-list-archive3"]
3b445493 » michalmarczyk
2010-06-17 Documented :mailing-list and :license in sample.project.clj.
24 :post "list@example.org"
25 :subscribe "list-subscribe@example.org"
26 :unsubscribe "list-unsubscribe@example.org"}
27 ;; The project's license. :distribution should be :repo or :manual;
28 ;; :repo means it is ok for public repositories to host this project's
19b44647 »
2010-12-24 Rework some of sample.project.clj.
29 ;; artifacts. A seq of :licenses is also supported.
3b445493 » michalmarczyk
2010-06-17 Documented :mailing-list and :license in sample.project.clj.
30 :license {:name "Eclipse Public License - v 1.0"
31 :url "http://www.eclipse.org/legal/epl-v10.html"
32 :distribution :repo
33 :comments "same as Clojure"}
915e61a8 »
2010-06-05 Add sample.project.clj showing all honored project keys.
34 ;; Dependencies are listed as [group-id/name version].
4ef309b4 »
2012-03-05 Update sample.project.clj for 2.0.0-preview.
35 :dependencies [[org.clojure/clojure "1.3.0"]
7c82e59a »
2012-04-09 Mention new `:dependencies` settings in sample.project.clj. Fixes #501.
36 [org.jclouds/jclouds "1.0" :classifier "jdk15" :scope "test"]
a8c06fbc » xeqi
2012-03-29 Change :type to :extension in sample. Fixes #457
37 [net.sf.ehcache/ehcache "2.3.1" :extension "pom"]
7c82e59a »
2012-04-09 Mention new `:dependencies` settings in sample.project.clj. Fixes #501.
38 [log4j "1.2.15" :exclusions [[javax.mail/mail :extension "jar"]
39 [javax.jms/jms :classifier "*"]
915e61a8 »
2010-06-05 Add sample.project.clj showing all honored project keys.
40 com.sun.jdmk/jmxtools
41 com.sun.jmx/jmxri]]]
ac9f135c » joegallo
2011-03-11 Add global :exclusions
42 ;; Global exclusions are applied across the board, as an alternative
43 ;; to duplication for multiple depedencies with the same excluded libraries.
44 :exclusions [org.apache.poi/poi
45 org.apache.poi/poi-ooxml]
6e5dee86 »
2012-04-10 Update sample.project.clj docs.
46 ;; Plugins are code that runs in Leiningen itself and usually
47 ;; provides new tasks or hooks.
4ef309b4 »
2012-03-05 Update sample.project.clj for 2.0.0-preview.
48 :plugins [[lein-pprint "1.1.1"]
c7f78676 »
2012-05-03 Clarify that :extensions aren't used by Leiningen. Fixes #555.
49 [lein-assoc "0.1.0"]
50 [s3-wagon-private "1.1.1"]]
2a089a13 »
2012-06-01 Document :certificates.
51 ;; If you configure a custom repository with a self-signed SSL
52 ;; certificate, you will need to add it here. Paths should be either
53 ;; be on Leiningen's classpath or relative to the project root.
54 :certificates ["blueant.pem"]
4ef309b4 »
2012-03-05 Update sample.project.clj for 2.0.0-preview.
55 ;; Each active profile gets merged into the project map. The :dev
56 ;; and :user profiles are active by default, but the latter should be
57 ;; looked up in ~/.lein/profiles.clj rather than set in project.clj.
58 ;; Use the with-profiles higher-order task to run a task with a
59 ;; different set of active profiles.
dff9a6cf »
2012-05-24 Spin off separate profile guide from readme/tutorial.
60 ;; See `lein help profiles` for a detailed explanation.
4ef309b4 »
2012-03-05 Update sample.project.clj for 2.0.0-preview.
61 :profiles {:dev {:resource-paths ["dummy-data"]
62 :dependencies [[clj-stacktrace "0.2.4"]]}
63 :debug {:debug true
21d9917a »
2012-03-28 Now :project-init is redundant with :injections.
64 :injections [(prn (into {} (System/getProperties)))]}
4ef309b4 »
2012-03-05 Update sample.project.clj for 2.0.0-preview.
65 :1.4 {:dependencies [[org.clojure/clojure "1.4.0-alpha1"]]}}
7c82e59a »
2012-04-09 Mention new `:dependencies` settings in sample.project.clj. Fixes #501.
66 ;; Support project-specific task aliases. These are interpreted in
67 ;; the same way as command-line arguments to the lein command. If
68 ;; the alias points to a vector, it uses partial application. For
69 ;; example, "lein with-magic run -m hi.core" would be equivalent to
a6a8695a » joegallo
2012-07-27 Document how commas are treated.
70 ;; "lein assoc :magic true run -m hi.core". Remember, commas are not
71 ;; considered to be special by argument parsers, they're just part
72 ;; of the preceding argument.
4ef309b4 »
2012-03-05 Update sample.project.clj for 2.0.0-preview.
73 :aliases {"launch" "run"
96507dc9 » joegallo
2012-07-27 Add test! back as an example alias.
74 "dumbrepl" ["trampoline" "run" "-m" "clojure.main/main"]
75 "test!" ["do" "clean," "deps," "test"]}
7c82e59a »
2012-04-09 Mention new `:dependencies` settings in sample.project.clj. Fixes #501.
76 ;; Normally Leiningen runs the javac and compile tasks before
77 ;; calling any eval-in-project code, but you can override this with
78 ;; the :prep-tasks key to do other things like compile protocol buffers.
68f1b075 » Anthony Marcar
2012-07-08 updated prep-tasks doco
79 :prep-tasks [["protobuf" "compile"] "javac" "compile"]
a4667096 »
2010-08-23 Minor cleanup of :min-lein-version functions.
80 ;; Warns users of earlier versions of Leiningen.
4ef309b4 »
2012-03-05 Update sample.project.clj for 2.0.0-preview.
81 :min-lein-version "2.0.0"
60a8ed82 »
2011-07-05 Clarify :checkout-deps-shares in sample.project.clj.
82 ;; Paths to include on the classpath from each project in the
83 ;; checkouts/ directory. (See the FAQ in the Readme for more details
84 ;; about checkout dependencies.) Set this to be a vector of
85 ;; functions that take the target project as argument. Defaults to
6e5dee86 »
2012-04-10 Update sample.project.clj docs.
86 ;; [:source-paths :compile-path :resource-paths], but you could use
60a8ed82 »
2011-07-05 Clarify :checkout-deps-shares in sample.project.clj.
87 ;; the following to share code from the test suite:
6e5dee86 »
2012-04-10 Update sample.project.clj docs.
88 :checkout-deps-shares [:source-paths :test-paths
60a8ed82 »
2011-07-05 Clarify :checkout-deps-shares in sample.project.clj.
89 ~(fn [p] (str (:root p) "/lib/dev/*"))]
4ef309b4 »
2012-03-05 Update sample.project.clj for 2.0.0-preview.
90 ;; Load these namespaces on startup to pick up hooks from them.
b5cb0cb5 »
2010-07-30 Don't load hooks unless they're specified in project.clj.
91 :hooks [leiningen.hooks.difftest]
683bdff9 » michaelklishin
2012-07-25 Correct :test-selectors example
92 ;; Predicates to determine whether to run a test or not, take test metadata
93 ;; as argument. See Leiningen tutorial for more information.
94 :test-selectors {:default (fn [m] (not (or (:integration m) (:regression m))))
ab0b885a »
2010-11-24 Mention :test-selectors in sample.project.clj.
95 :integration :integration
96 :regression :regression}
915e61a8 »
2010-06-05 Add sample.project.clj showing all honored project keys.
97 ;; These namespaces will be AOT-compiled. Needed for gen-class and
6e5dee86 »
2012-04-10 Update sample.project.clj docs.
98 ;; other Java interop functionality. Put a regex here to compile all
99 ;; namespaces whose names match.
15ff6b11 »
2011-01-24 A few doc changes.
100 :aot [org.example.sample]
ecfbac67 » michaelklishin
2012-07-31 Minor improvements to sample.project.clj, closes #710
101 ;; The -main function in this namespace will be run at launch (either via `lein run` or if you
102 ;; create an uberjar). It should be variadic, like so:
103 ;;
f66c7474 » michaelklishin
2012-07-31 Mention :gen-class, references #710
104 ;; (ns my.service.runner
105 ;; (:gen-class))
106 ;;
ecfbac67 » michaelklishin
2012-07-31 Minor improvements to sample.project.clj, closes #710
107 ;; (defn -main
108 ;; "Application entry point"
109 ;; [& args]
110 ;; (comment Do app initialization here))
111 ;;
112 ;; Set :skip-aot metadata on this symbol to use
6e5dee86 »
2012-04-10 Update sample.project.clj docs.
113 ;; it for other things like the run task or shell wrappers without
114 ;; bringing in AOT if you don't need an executable uberjar.
ecfbac67 » michaelklishin
2012-07-31 Minor improvements to sample.project.clj, closes #710
115 :main my.service.runner
c6697f76 » dakrone
2012-04-10 Collapse all repl-* options into :repl-options map
116 ;; Options to change the way the REPL behaves
b48eec97 » trptcolin
2012-04-11 Handle starting in a different ns
117 :repl-options {;; Specify the string to print when prompting for input.
118 ;; defaults to something like (fn [ns] (str *ns* "=> "))
119 :prompt (fn [ns] (str "your command for <" ns ">, master? " ))
120 ;; Specify the ns to start the REPL in (overrides :main in
121 ;; this case only)
122 :init-ns foo.bar
123 ;; This expression will run when first opening a REPL, in the
124 ;; namespace from :init-ns or :main if specified
125 :init (println "here we are in" *ns*)
c6697f76 » dakrone
2012-04-10 Collapse all repl-* options into :repl-options map
126 ;; Customize the socket the repl task listens on and
127 ;; attaches to.
128 :host "0.0.0.0"
129 :port 4001
130 ;; If nREPL takes too long to load it may timeout,
131 ;; increase this to wait longer before timing out.
132 ;; Defaults to 30000 (30 seconds)
133 :timeout 40000}
21d9917a »
2012-03-28 Now :project-init is redundant with :injections.
134 ;; Forms to prepend to every form that is evaluated inside your project.
4ef309b4 »
2012-03-05 Update sample.project.clj for 2.0.0-preview.
135 ;; Allows working around the Gilardi Scenario: http://technomancy.us/143
21d9917a »
2012-03-28 Now :project-init is redundant with :injections.
136 :injections [(require 'clojure.pprint)]
915e61a8 »
2010-06-05 Add sample.project.clj showing all honored project keys.
137 ;; Emit warnings on all reflection calls.
138 :warn-on-reflection true
4ef309b4 »
2012-03-05 Update sample.project.clj for 2.0.0-preview.
139 ;; Set this in order to only use the :repositories you list below.
915e61a8 »
2010-06-05 Add sample.project.clj showing all honored project keys.
140 :omit-default-repositories true
4ef309b4 »
2012-03-05 Update sample.project.clj for 2.0.0-preview.
141 ;; These repositories will be searched for :dependencies and
142 ;; :plugins and will also be available to deploy to.
143 :repositories {"java.net" "http://download.java.net/maven/2"
144 "sonatype"
145 {:url "http://oss.sonatype.org/content/repositories/releases"
146 ;; If a repository contains releases only; setting :snapshots
147 ;; to false will speed up dependency checking.
148 :snapshots false
149 ;; You can also set the policies for how to handle :checksum
150 ;; failures to :fail, :warn, or :ignore. In :releases, :daily,
151 ;; :always, and :never are supported.
176bcf5e »
2012-05-11 Add :update support at the top-level of the project map.
152 :releases {:checksum :fail :update :always}
153 ;; You can set :checksum and :update here for them
154 ;; to apply to both :releases and :snapshots:
155 :update :always, :checksum :fail}
fc7ad701 »
2011-04-11 Add more :repositories settings details to sample project.clj.
156 ;; Repositories named "snapshots" and "releases" automatically
157 ;; have their :snapshots and :releases disabled as appropriate.
4ef309b4 »
2012-03-05 Update sample.project.clj for 2.0.0-preview.
158 ;; Credentials for repositories should *not* be stored
159 ;; in project.clj but in ~/.lein/profiles.clj instead:
160 ;; {:auth {:repository-auth {#"http://blueant.com/archiva/"
161 ;; {:username "milgrim"
162 ;; :password "locative.1"}}}}
163 "snapshots" "http://blueant.com/archiva/snapshots"
674b4d52 »
2012-06-01 Replace :env values in :repositories with lookups from environment.
164 "releases" {:url "http://blueant.com/archiva/internal"
165 ;; Using :env as a value here will cause an
166 ;; enironment variable to be used based on
167 ;; the key; in this case LEIN_PASSWORD.
168 :username "milgrim" :password :env}}
176bcf5e »
2012-05-11 Add :update support at the top-level of the project map.
169 ;; You can set :update and :checksum policies here to have them
7d641026 »
2012-05-11 Allow :checksum policy to be set at the top-level of project.clj as w…
170 ;; apply for all :repositories. Usually you will not set :update
176bcf5e »
2012-05-11 Add :update support at the top-level of the project map.
171 ;; directly but apply the "update" profile instead.
172 :update :always
b889a8b5 » michaelklishin
2012-07-27 A better default/example
173 :checksum :fail
bd6959c3 » cemerick
2011-09-15 Add support for :deploy-repositories slot for deployment-only reposit…
174 ;; the deploy task will give preference to repositories specified in
175 ;; :deploy-repositories, and repos listed there will not be used for
4ef309b4 »
2012-03-05 Update sample.project.clj for 2.0.0-preview.
176 ;; dependency resolution.
177 :deploy-repositories {"releases" "http://blueant.com/archiva/internal/releases"
178 "snapshots" "http://blueant.com/archiva/internal/snapshots"}
a32abdf5 »
2012-06-25 Plumb through mirror support to pomegranate. Fixes #271.
179 ;; Fetch dependencies from mirrors. Mirrors override repositories when the key
180 ;; in the :mirrors map matches either the name or URL of a specified
181 ;; repository. All settings supported in :repositories may be set here too.
182 :mirrors {"central" {:name "Ibiblio"
183 :url "http://mirrors.ibiblio.org/pub/mirrors/maven2"}
184 #"clojars" {:name "Internal nexus"
185 :url "http://mvn.local/nexus/releases"
186 :repo-manager true}}
a62ff253 »
2012-03-06 Update sample, readme, todo.
187 ;; Prevent Leiningen from checking the network for dependencies.
188 ;; This wouldn't normally be set in project.clj; it would come from a profile.
189 :offline? true
190 ;; Override the location of the local maven repository.
191 :local-repo "/home/dude/.lein/repo"
915e61a8 »
2010-06-05 Add sample.project.clj showing all honored project keys.
192 ;; If you'd rather use a different directory structure, you can set these.
4ef309b4 »
2012-03-05 Update sample.project.clj for 2.0.0-preview.
193 ;; Paths that contain "inputs" are vectors, "outputs" are strings.
194 :source-paths ["src" "src/main/clojure"]
6e5dee86 »
2012-04-10 Update sample.project.clj docs.
195 :java-source-paths ["src/main/java"] ; Java source is stored separately.
4ef309b4 »
2012-03-05 Update sample.project.clj for 2.0.0-preview.
196 :test-paths ["test" "src/test/clojure"]
197 :resource-paths ["src/main/resource"] ; non-code files included in classpath/jar
6e5dee86 »
2012-04-10 Update sample.project.clj docs.
198 :compile-path "target/classes" ; for .class files
39a6b2c6 »
2012-03-31 Remove Clojure 1.2 from bootclasspath in lein.bat. Might fix #486.
199 :native-path "src/native" ; where to extract native dependencies
5458e659 » dysinger
2012-03-24 Make the sample file match the code
200 :target-path "target/" ; where to place the project's jar file
18becb7a »
2011-04-22 Add :extra-classpath-dirs to project classpaths.
201 :jar-name "sample.jar" ; name of the jar produced by 'lein jar'
ae72f2db » michalmarczyk
2010-06-24 Documented :jar-name & :uberjar-name in sample.project.clj.
202 :uberjar-name "sample-standalone.jar" ; as above for uberjar
745a7a63 » michaelklishin
2012-07-14 Update sample.project.clj to use the new `:javac-options` format
203 ;; Options to pass to java compiler for java source,
204 ;; exactly the same as command line arguments to javac
205 :javac-options ["-target" "1.6" "-source" "1.6" "-Xlint:-options"]
6e5dee86 »
2012-04-10 Update sample.project.clj docs.
206 ;; Leave the contents of :source-paths out of jars (for AOT projects)
0e189a8d »
2010-08-16 Add :omit-source option to leave files in :source-path out of jars.
207 :omit-source true
acc9a828 »
2010-09-23 Specify what file patterns to exclude from jars. Thanks to Zehua Liu.
208 ;; Files with names matching any of these patterns will be excluded from jars
209 :jar-exclusions [#"(?:^|/).svn/"]
2bda774e »
2010-11-20 Add :uberjar-exclusions to project.clj.
210 ;; Same thing, but for uberjars.
211 :uberjar-exclusions [#"META-INF/DUMMY.SF"]
03d66321 »
2012-04-03 Document :filespecs in sample project.clj.
212 ;; Add arbitrary jar entries. Supports :path, :paths, :bytes, and :fn types.
213 :filespecs [{:type :path :path "config/base.clj"}
214 ;; directory paths are included recursively
215 {:type :paths :paths ["config/web" "config/cli"]}
216 ;; programmatically-generated content can use :bytes
217 {:type :bytes :path "project.clj"
218 ;; strings or byte arrays are accepted
219 :bytes ~(slurp "project.clj")}
220 ;; :fn filespecs take the project as an argument and
221 ;; should return a filespec map of one of the other types.
222 {:type :fn :fn (fn [p]
223 {:type :bytes :path "git-log"
224 :bytes (:out (clojure.java.shell/sh
225 "git" "log" "-n" "1"))})}]
09662298 »
2010-08-08 Clean up make-manifest. Fixes #46.
226 ;; Set arbitrary key/value pairs for the jar's manifest.
0016f04e »
2012-04-30 Allow :manifest entries to contain functions.
227 :manifest {"Project-awesome-level" "super-great"
228 ;; function values will be called with the project as an argument.
229 "Class-Path" ~#(clojure.string/join
36542286 »
2012-04-30 Use space in sample for classpath.
230 \space
0016f04e »
2012-04-30 Allow :manifest entries to contain functions.
231 (leiningen.core.classpath/get-classpath %))
232 ;; symbol values will be resolved to find a function to call.
233 "Grunge-level" my.plugin/calculate-grunginess}
915e61a8 »
2010-06-05 Add sample.project.clj showing all honored project keys.
234 ;; You can set JVM-level options here.
f732bfee »
2010-10-24 Support :eval-in-leiningen key in project.clj for plugins.
235 :jvm-opts ["-Xmx1g"]
6e5dee86 »
2012-04-10 Update sample.project.clj docs.
236 ;; Control the context in which your project code is evaluated.
237 ;; Defaults to :subprocess, but can also be :leiningen (for plugins)
238 ;; or :classloader (experimental) to avoid starting a subprocess.
239 :eval-in :leiningen
c2637834 »
2012-06-15 Turn :bootclasspath off by default; too many issues for now.
240 ;; Enable bootclasspath optimization. This improves boot time but interferes
2f2bd69b »
2012-06-14 Fix tests for bootclasspath.
241 ;; with using things like pomegranate at runtime and using Clojure 1.2.
c2637834 »
2012-06-15 Turn :bootclasspath off by default; too many issues for now.
242 :bootclasspath true
07a755c8 » gmwils
2011-11-04 Add :parent to sample.project.clj
243 ;; Set parent for working with in a multi-module maven project
ef2b0f0b » xeqi
2012-01-19 Copy pom.xml generation from depot
244 :parent [org.example/parent "0.0.1" :relative-path "../parent/pom.xml"]
c7f78676 »
2012-05-03 Clarify that :extensions aren't used by Leiningen. Fixes #555.
245 ;; Extensions here will be propagated to the pom but not used by Leiningen.
ef2b0f0b » xeqi
2012-01-19 Copy pom.xml generation from depot
246 :extensions [[org.apache.maven.wagon/wagon-webdav "1.0-beta-2"]
0bd7ab2a » winks
2012-06-20 Add :scm to sample.project.clj (#640)
247 [foo/bar-baz "1.0"]]
5d40f19c »
2012-07-26 Add environment variables reference to the bottom of sample.project.clj.
248 ;; Include <scm> tag in generated pom.xml file. All key/value pairs
249 ;; appear exactly as configured. If absent, Leiningen will try to
250 ;; use information from a .git directory.
0bd7ab2a » winks
2012-06-20 Add :scm to sample.project.clj (#640)
251 :scm {:name "git" :tag "098afd745bcd" :url "http://127.0.0.1/git/my-project"})
5d40f19c »
2012-07-26 Add environment variables reference to the bottom of sample.project.clj.
252
253 ;;; Environment Variables used by Leiningen
254
255 ;; JAVA_CMD - executable to use for java(1)
256 ;; JVM_OPTS - extra options to pass to the java command
257 ;; DEBUG - increased verbosity
258 ;; LEIN_SNAPSHOTS_IN_RELEASE - allow releases to depend on snapshots
e7474a84 »
2012-07-27 Update env var reference.
259 ;; LEIN_REPL_HOST - interface on which to connect to nREPL server
260 ;; LEIN_REPL_PORT - port on which to start or connect to nREPL server
5d40f19c »
2012-07-26 Add environment variables reference to the bottom of sample.project.clj.
261 ;; http_proxy - host and port to proxy HTTP connections through
e7474a84 »
2012-07-27 Update env var reference.
262 ;; http_no_proxy - pipe-separated list of hosts which may be accessed directly
Something went wrong with that request. Please try again.