Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 493 lines (476 sloc) 28.04 kB
e50be00 @technomancy Rearrange sample.project.clj.
authored
1 ;; This is an annotated reference of the options that may be set in a
2 ;; project.clj file. It is fairly contrived in order to cover lots of
3 ;; different options; it shouldn't be considered a representative
4 ;; configuration. For a more detailed explanation of some of the terms
9718597 @technomancy Update sample.project.clj and NEWS.md.
authored
5 ;; run `lein help tutorial`.
915e61a @technomancy Add sample.project.clj showing all honored project keys.
authored
6
14f566b @technomancy Spin FAQ off into its own page.
authored
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
915e61a @technomancy Add sample.project.clj showing all honored project keys.
authored
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"
3e7f75e @technomancy Mention unquote in sample.project.clj
authored
12 ;; Beyond this point you may prepend a form with unquote, or ~, to eval it.
13
8b98d68 @technomancy Default to warning when version ranges are present.
authored
14 ;;; Project Metadata
4d07b5e @maerz Update sample.project.clj
maerz authored
15 ;; The description text is searchable from repositories like Clojars.
915e61a @technomancy Add sample.project.clj showing all honored project keys.
authored
16 :description "A sample project"
17 :url "http://example.org/sample-clojure-project"
3b44549 @michalmarczyk Documented :mailing-list and :license in sample.project.clj.
michalmarczyk authored
18 ;; The mailing list of the project. If the project has multiple mailing
19 ;; lists, use the :mailing-lists key (bound to a seq of mailing list
20 ;; descriptions as below).
21 :mailing-list {:name "sample mailing list"
22 :archive "http://example.org/sample-mailing-list-archives"
c43ee75 @technomancy Trim long lines.
authored
23 :other-archives ["http://example.org/sample-list-archive2"
24 "http://example.org/sample-list-archive3"]
3b44549 @michalmarczyk Documented :mailing-list and :license in sample.project.clj.
michalmarczyk authored
25 :post "list@example.org"
26 :subscribe "list-subscribe@example.org"
27 :unsubscribe "list-unsubscribe@example.org"}
28 ;; The project's license. :distribution should be :repo or :manual;
6de6b8c @daemianmack Fix typos.
daemianmack authored
29 ;; :repo means it is OK for public repositories to host this project's
19b4464 @technomancy Rework some of sample.project.clj.
authored
30 ;; artifacts. A seq of :licenses is also supported.
3b44549 @michalmarczyk Documented :mailing-list and :license in sample.project.clj.
michalmarczyk authored
31 :license {:name "Eclipse Public License - v 1.0"
32 :url "http://www.eclipse.org/legal/epl-v10.html"
33 :distribution :repo
34 :comments "same as Clojure"}
9718597 @technomancy Update sample.project.clj and NEWS.md.
authored
35 ;; Warns users of earlier versions of Leiningen. Set this if your project
36 ;; relies on features only found in newer Leiningen versions.
e50be00 @technomancy Rearrange sample.project.clj.
authored
37 :min-lein-version "2.0.0"
38
8b98d68 @technomancy Default to warning when version ranges are present.
authored
39 ;;; Dependencies, Plugins, and Repositories
8540c73 @marcliberatore document user-visible changes addressing #898
marcliberatore authored
40 ;; Dependencies are listed as [group-id/name version]; in addition
41 ;; to keywords supported by Pomegranate, you can use :native-prefix
42 ;; to specify a prefix. This prefix is used to extract natives in
43 ;; jars that don't adhere to the default "<os>/<arch>/" layout that
44 ;; Leiningen expects.
4ef309b @technomancy Update sample.project.clj for 2.0.0-preview.
authored
45 :dependencies [[org.clojure/clojure "1.3.0"]
d0b7cd7 @technomancy Remove :scope from sample.project.clj.
authored
46 [org.jclouds/jclouds "1.0" :classifier "jdk15"]
a8c06fb @xeqi Change :type to :extension in sample. Fixes #457
xeqi authored
47 [net.sf.ehcache/ehcache "2.3.1" :extension "pom"]
7c82e59 @technomancy Mention new `:dependencies` settings in sample.project.clj. Fixes #501.
authored
48 [log4j "1.2.15" :exclusions [[javax.mail/mail :extension "jar"]
49 [javax.jms/jms :classifier "*"]
915e61a @technomancy Add sample.project.clj showing all honored project keys.
authored
50 com.sun.jdmk/jmxtools
8540c73 @marcliberatore document user-visible changes addressing #898
marcliberatore authored
51 com.sun.jmx/jmxri]]
52 [org.lwjgl.lwjgl/lwjgl "2.8.5"]
53 [org.lwjgl.lwjgl/lwjgl-platform "2.8.5"
54 :classifier "natives-osx"
55 ;; LWJGL stores natives in the root of the jar; this
56 ;; :native-prefix will extract them.
57 :native-prefix ""]]
8b98d68 @technomancy Default to warning when version ranges are present.
authored
58 ;; What to do in the case of version issues. Defaults to :ranges, which
59 ;; warns when version ranges are present anywhere in the dependency tree,
60 ;; but can be set to true to warn for both ranges and overrides, or :abort
61 ;; to exit in the case of ranges or overrides.
5b26b89 @technomancy Support :pedantic? :abort/:warn.
authored
62 :pedantic? :abort
ac9f135 @joegallo Add global :exclusions
joegallo authored
63 ;; Global exclusions are applied across the board, as an alternative
6de6b8c @daemianmack Fix typos.
daemianmack authored
64 ;; to duplication for multiple dependencies with the same excluded libraries.
ac9f135 @joegallo Add global :exclusions
joegallo authored
65 :exclusions [org.apache.poi/poi
66 org.apache.poi/poi-ooxml]
6e5dee8 @technomancy Update sample.project.clj docs.
authored
67 ;; Plugins are code that runs in Leiningen itself and usually
6de6b8c @daemianmack Fix typos.
daemianmack authored
68 ;; provide new tasks or hooks.
4ef309b @technomancy Update sample.project.clj for 2.0.0-preview.
authored
69 :plugins [[lein-pprint "1.1.1"]
c7f7867 @technomancy Clarify that :extensions aren't used by Leiningen. Fixes #555.
authored
70 [lein-assoc "0.1.0"]
ff5524b @ninjudd support disabling autoload of plugin hooks and middleware
ninjudd authored
71 [s3-wagon-private "1.1.1"]
72 [lein-foo "0.0.1" :hooks false]
73 [lein-bar "0.0.1" :middleware false]]
e50be00 @technomancy Rearrange sample.project.clj.
authored
74 ;; These repositories will be searched for :dependencies and
75 ;; :plugins and will also be available to deploy to.
9718597 @technomancy Update sample.project.clj and NEWS.md.
authored
76 ;; Add ^:replace (:repositories ^:replace [...]) to only use repositories you
77 ;; list below.
e50be00 @technomancy Rearrange sample.project.clj.
authored
78 :repositories [["java.net" "http://download.java.net/maven/2"]
79 ["sonatype" {:url "http://oss.sonatype.org/content/repositories/releases"
80 ;; If a repository contains releases only setting
81 ;; :snapshots to false will speed up dependencies.
82 :snapshots false
9718597 @technomancy Update sample.project.clj and NEWS.md.
authored
83 ;; Disable signing releases deployed to this repo.
e50be00 @technomancy Rearrange sample.project.clj.
authored
84 ;; (Not recommended.)
85 :sign-releases false
86 ;; You can also set the policies for how to handle
87 ;; :checksum failures to :fail, :warn, or :ignore.
88 :checksum :fail
9718597 @technomancy Update sample.project.clj and NEWS.md.
authored
89 ;; How often should this repository be checked for
90 ;; snapshot updates? (:daily, :always, or :never)
e50be00 @technomancy Rearrange sample.project.clj.
authored
91 :update :always
92 ;; You can also apply them to releases only:
93 :releases {:checksum :fail :update :always}}]
94 ;; Repositories named "snapshots" and "releases" automatically
95 ;; have their :snapshots and :releases disabled as appropriate.
96 ;; Credentials for repositories should *not* be stored
97 ;; in project.clj but in ~/.lein/credentials.clj.gpg instead,
98 ;; see `lein help deploying` under "Authentication".
99 ["snapshots" "http://blueant.com/archiva/snapshots"]
100 ["releases" {:url "http://blueant.com/archiva/internal"
101 ;; Using :env as a value here will cause an
102 ;; environment variable to be used based on
103 ;; the key; in this case LEIN_PASSWORD.
104 :username "milgrim" :password :env}]]
105 ;; These repositories will be included with :repositories when loading plugins.
106 ;; This would normally be set in a profile for non-public repositories.
107 ;; All the options are the same as in the :repositories map.
108 :plugin-repositories [["internal-plugin-repo" "http://example.org/repo"]]
109 ;; Fetch dependencies from mirrors. Mirrors override repositories when the key
110 ;; in the :mirrors map matches either the name or URL of a specified
111 ;; repository. All settings supported in :repositories may be set here too.
4938e6c @technomancy Clarify :mirrors naming requirement.
authored
112 ;; The :name should match the name of the mirrored repository.
113 :mirrors {"central" {:name "central"
e50be00 @technomancy Rearrange sample.project.clj.
authored
114 :url "http://mirrors.ibiblio.org/pub/mirrors/maven2"}
115 #"clojars" {:name "Internal nexus"
116 :url "http://mvn.local/nexus/releases"
117 :repo-manager true}}
118 ;; Override location of the local maven repository. Relative to project root.
119 :local-repo "local-m2"
120 ;; You can set :update and :checksum policies here to have them
121 ;; apply for all :repositories. Usually you will not set :update
122 ;; directly but apply the "update" profile instead.
123 :update :always
124 :checksum :fail
125 ;; Prevent Leiningen from checking the network for dependencies.
126 ;; This wouldn't normally be set in project.clj; it would come from a profile.
127 :offline? true
128 ;; the deploy task will give preference to repositories specified in
129 ;; :deploy-repositories, and repos listed there will not be used for
130 ;; dependency resolution.
131 :deploy-repositories [["releases" {:url "http://blueant.com/archiva/internal/releases"
132 ;; Select a GPG private key to use for
133 ;; signing. (See "How to specify a user
134 ;; ID" in GPG's manual.) GPG will
135 ;; otherwise pick the first private key
136 ;; it finds in your keyring.
137 ;; Currently only works in :deploy-repositories
138 ;; or as a top-level (global) setting.
139 :signing {:gpg-key "0xAB123456"}}]
140 ["snapshots" "http://blueant.com/archiva/internal/snapshots"]]
141 ;; Defaults for signing options. Defers to per-repository settings.
142 :signing {:gpg-key "root@eruditorum.org"}
2a089a1 @technomancy Document :certificates.
authored
143 ;; If you configure a custom repository with a self-signed SSL
4d07b5e @maerz Update sample.project.clj
maerz authored
144 ;; certificate, you will need to add it here. Paths should either
2a089a1 @technomancy Document :certificates.
authored
145 ;; be on Leiningen's classpath or relative to the project root.
146 :certificates ["blueant.pem"]
e50be00 @technomancy Rearrange sample.project.clj.
authored
147
8b98d68 @technomancy Default to warning when version ranges are present.
authored
148 ;;; Profiles
4ef309b @technomancy Update sample.project.clj for 2.0.0-preview.
authored
149 ;; Each active profile gets merged into the project map. The :dev
150 ;; and :user profiles are active by default, but the latter should be
151 ;; looked up in ~/.lein/profiles.clj rather than set in project.clj.
152 ;; Use the with-profiles higher-order task to run a task with a
153 ;; different set of active profiles.
dff9a6c @technomancy Spin off separate profile guide from readme/tutorial.
authored
154 ;; See `lein help profiles` for a detailed explanation.
e812955 @technomancy Improve profile coverage in sample.project.clj.
authored
155 :profiles {:debug {:debug true
21d9917 @technomancy Now :project-init is redundant with :injections.
authored
156 :injections [(prn (into {} (System/getProperties)))]}
c11cdca Update sample.project.clj
Michael Klishin authored
157 :1.4 {:dependencies [[org.clojure/clojure "1.4.0"]]}
e812955 @technomancy Improve profile coverage in sample.project.clj.
authored
158 :1.5 {:dependencies [[org.clojure/clojure "1.5.0"]]}
159 ;; activated by default
160 :dev {:resource-paths ["dummy-data"]
161 :dependencies [[clj-stacktrace "0.2.4"]]}
162 ;; activated automatically during uberjar
163 :uberjar {:aot :all}
164 ;; activated automatically in repl task
165 :repl {:plugins [[cider/cider-nrepl "0.7.1"]]}}
e50be00 @technomancy Rearrange sample.project.clj.
authored
166 ;; Load these namespaces from within Leiningen to pick up hooks from them.
167 :hooks [leiningen.hooks.difftest]
8b9d66c @technomancy Allow implicit hooks/middleware to be disabled.
authored
168 ;; Apply these middleware functions from plugins to your project
169 ;; when it loads. Both hooks and middleware can be loaded implicitly
170 ;; or by being listed here.
e50be00 @technomancy Rearrange sample.project.clj.
authored
171 :middleware [lein-xml.plugin/middleware]
8b9d66c @technomancy Allow implicit hooks/middleware to be disabled.
authored
172 ;; These settings disable the implicit loading of middleware and
173 ;; hooks, respectively. You can disable both with :implicits false.
174 :implicit-middleware false
175 :implicit-hooks false
e50be00 @technomancy Rearrange sample.project.clj.
authored
176
8b98d68 @technomancy Default to warning when version ranges are present.
authored
177 ;;; Entry Point
e50be00 @technomancy Rearrange sample.project.clj.
authored
178 ;; The -main function in this namespace will be run at launch
179 ;; (either via `lein run` or from an uberjar). It should be variadic:
180 ;;
181 ;; (ns my.service.runner
182 ;; (:gen-class))
183 ;;
184 ;; (defn -main
185 ;; "Application entry point"
186 ;; [& args]
187 ;; (comment Do app initialization here))
188 ;;
189 ;; This will be AOT compiled by default; to disable this, attach ^:skip-aot
c76ac8d @hyPiRion Add ^:skip-aot as default for app template.
hyPiRion authored
190 ;; metadata to the namespace symbol. ^:skip-aot will not disable AOT
191 ;; compilation of :main when :aot is :all or contains the main class. It's
192 ;; best to be explicit with the :aot key rather than relying on
0f59054 @paxan How to opt out from "Main-Class: clojure.main"
paxan authored
193 ;; auto-compilation of :main. Setting :main to nil is useful when a
194 ;; project contains several main functions. nil will produce a jar
195 ;; with manifest.mf that lacks `Main-Class' property.
e50be00 @technomancy Rearrange sample.project.clj.
authored
196 :main my.service.runner
7c82e59 @technomancy Mention new `:dependencies` settings in sample.project.clj. Fixes #501.
authored
197 ;; Support project-specific task aliases. These are interpreted in
198 ;; the same way as command-line arguments to the lein command. If
199 ;; the alias points to a vector, it uses partial application. For
200 ;; example, "lein with-magic run -m hi.core" would be equivalent to
a6a8695 @joegallo Document how commas are treated.
joegallo authored
201 ;; "lein assoc :magic true run -m hi.core". Remember, commas are not
202 ;; considered to be special by argument parsers, they're just part
203 ;; of the preceding argument.
46f1556 @technomancy Document partial alias splicing.
authored
204 :aliases {"launch" ["run" "-m" "myproject.main"]
205 ;; Values from the project map can be spliced into the arguments
206 ;; using :project/key keywords.
207 "launch-version" ["run" "-m" "myproject.main" :project/version]
96507dc @joegallo Add test! back as an example alias.
joegallo authored
208 "dumbrepl" ["trampoline" "run" "-m" "clojure.main/main"]
6ed53ab @hyPiRion Add :pass-through-help documentation.
hyPiRion authored
209 ;; :pass-through-help ensures `lein my-alias help` is not converted
210 ;; into `lein help my-alias`.
211 "go" ^:pass-through-help ["run" "-m"]
e50be00 @technomancy Rearrange sample.project.clj.
authored
212 ;; For complex aliases, a docstring may be attached. The docstring
213 ;; will be printed instead of the expansion when running `lein help`.
63ab148 @hyPiRion Rename sample alias to something sensible.
hyPiRion authored
214 "deploy!" ^{:doc "Recompile sources, then deploy if tests succeed."}
ae2e789 @hyPiRion Support nested `do` chains, remove implicit help.
hyPiRion authored
215 ;; Nested vectors are supported for the "do" task
216 ["do" "clean" ["test" ":integration"] ["deploy" "clojars"]]}
e50be00 @technomancy Rearrange sample.project.clj.
authored
217
8b98d68 @technomancy Default to warning when version ranges are present.
authored
218 ;;; Custom Release Tasks
9b652d7 @waynr Document the release task.
waynr authored
219 ;; By default `lein release` performs a series of tasks typical of the release
220 ;; process for many leiningen-managed projects. These tasks can be overridden
221 ;; using `:release-tasks` as follows:
222 :release-tasks [["vcs" "assert-committed"]
223 ["change" "version"
224 "leiningen.release/bump-version" "release"]
225 ["vcs" "commit"]
226 ["vcs" "tag"]
227 ["deploy"]]
228 ;; This differs from the default `:release-tasks` behavior in that it doesn't
229 ;; go on to perform another `change version` or `vcs` task, instead leaving
230 ;; that up to the developer to do manually.
231
8b98d68 @technomancy Default to warning when version ranges are present.
authored
232 ;;; Running Project Code
7c82e59 @technomancy Mention new `:dependencies` settings in sample.project.clj. Fixes #501.
authored
233 ;; Normally Leiningen runs the javac and compile tasks before
234 ;; calling any eval-in-project code, but you can override this with
235 ;; the :prep-tasks key to do other things like compile protocol buffers.
68f1b07 updated prep-tasks doco
Anthony Marcar authored
236 :prep-tasks [["protobuf" "compile"] "javac" "compile"]
e50be00 @technomancy Rearrange sample.project.clj.
authored
237 ;; These namespaces will be AOT-compiled. Needed for gen-class and
238 ;; other Java interop functionality. Put a regex here to compile all
9718597 @technomancy Update sample.project.clj and NEWS.md.
authored
239 ;; namespaces whose names match. If you only need AOT for an uberjar
240 ;; gen-class, put `:aot :all` in the :uberjar profile and see :target-path for
241 ;; how to enable profile-baset target isolation.
e50be00 @technomancy Rearrange sample.project.clj.
authored
242 :aot [org.example.sample]
243 ;; Forms to prepend to every form that is evaluated inside your project.
244 ;; Allows working around the Gilardi Scenario: http://technomancy.us/143
245 :injections [(require 'clojure.pprint)]
246 ;; Java agents can instrument and intercept certain VM features. Include
247 ;; :bootclasspath true to place the agent jar on the bootstrap classpath.
248 :java-agents [[nodisassemble "0.1.1" :options "extra"]]
249 ;; Options to pass to java compiler for java source,
250 ;; exactly the same as command line arguments to javac.
251 :javac-options ["-target" "1.6" "-source" "1.6" "-Xlint:-options"]
252 ;; Emit warnings on all reflection calls. - DEPRECATED (see below)
253 :warn-on-reflection true
9718597 @technomancy Update sample.project.clj and NEWS.md.
authored
254 ;; Sets the values of global vars within Clojure. This example
255 ;; disables all pre- and post-conditions and emits warnings on
256 ;; reflective calls. See the Clojure documentation for the list of
257 ;; valid global variables to set (and their meaningful values).
e50be00 @technomancy Rearrange sample.project.clj.
authored
258 :global-vars {*warn-on-reflection* true
259 *assert* false}
9718597 @technomancy Update sample.project.clj and NEWS.md.
authored
260 ;; Use a different `java` executable for project JVMs. Leiningen's own JVM is
261 ;; set with the LEIN_JAVA_CMD environment variable.
e50be00 @technomancy Rearrange sample.project.clj.
authored
262 :java-cmd "/home/phil/bin/java1.7"
9718597 @technomancy Update sample.project.clj and NEWS.md.
authored
263 ;; You can set JVM-level options here. The :java-opts key is an alias for this.
e50be00 @technomancy Rearrange sample.project.clj.
authored
264 :jvm-opts ["-Xmx1g"]
9718597 @technomancy Update sample.project.clj and NEWS.md.
authored
265 ;; Set the context in which your project code is evaluated. Defaults
266 ;; to :subprocess, but can also be :leiningen (for plugins) or :nrepl
267 ;; to connect to an existing project process over nREPL. A project nREPL
268 ;; server can be started simply by invoking `lein repl`. If no connection
269 ;; can be established, :nrepl falls back to :subprocess.
e50be00 @technomancy Rearrange sample.project.clj.
authored
270 :eval-in :leiningen
271 ;; Enable bootclasspath optimization. This improves boot time but interferes
9718597 @technomancy Update sample.project.clj and NEWS.md.
authored
272 ;; with certain libraries like Jetty that make assumptions about classloaders.
e50be00 @technomancy Rearrange sample.project.clj.
authored
273 :bootclasspath true
274
8b98d68 @technomancy Default to warning when version ranges are present.
authored
275 ;;; Filesystem Paths
e50be00 @technomancy Rearrange sample.project.clj.
authored
276 ;; If you'd rather use a different directory structure, you can set these.
9718597 @technomancy Update sample.project.clj and NEWS.md.
authored
277 ;; Paths that contain "inputs" are string vectors, "outputs" are strings.
e50be00 @technomancy Rearrange sample.project.clj.
authored
278 :source-paths ["src" "src/main/clojure"]
8b98d68 @technomancy Default to warning when version ranges are present.
authored
279 :java-source-paths ["src/main/java"] ; Java source is stored separately.
e50be00 @technomancy Rearrange sample.project.clj.
authored
280 :test-paths ["test" "src/test/clojure"]
281 :resource-paths ["src/main/resource"] ; Non-code files included in classpath/jar.
9718597 @technomancy Update sample.project.clj and NEWS.md.
authored
282 ;; All generated files will be placed in :target-path. In order to avoid
41f7a29 @graue Fix punctuation in sample.project.clj comment
graue authored
283 ;; cross-profile contamination (for instance, uberjar classes interfering
284 ;; with development), it's recommended to include %s in in your custom
9718597 @technomancy Update sample.project.clj and NEWS.md.
authored
285 ;; :target-path, which will splice in names of the currently active profiles.
286 :target-path "target/%s/"
e50be00 @technomancy Rearrange sample.project.clj.
authored
287 ;; Directory in which to place AOT-compiled files. Including %s will
288 ;; splice the :target-path into this value.
289 :compile-path "%s/classy-files"
290 ;; Directory in which to extract native components from inside dependencies.
291 ;; Including %s will splice the :target-path into this value. Note that this
292 ;; is not where to *look* for existing native libraries; use :jvm-opts with
293 ;; -Djava.library.path=... instead for that.
294 :native-path "%s/bits-n-stuff"
295 ;; Directories under which `lein clean` removes files.
296 ;; Specified by keyword or keyword-chain to get-in path in this defproject.
297 ;; Both a single path and a collection of paths are accepted as each.
298 ;; For example, if the other parts of project are like:
299 ;; :target-path "target"
300 ;; :compile-path "classes"
301 ;; :foobar-paths ["foo" "bar"]
302 ;; :baz-config {:qux-path "qux"}
303 ;; :clean-targets below lets `lein clean` remove files under "target",
304 ;; "classes", "foo", "bar", "qux", and "out".
a5cf442 @cpmcdaniel Support for overriding :clean-targets sanity checking (issue #1458).
cpmcdaniel authored
305 ;; By default, will protect paths outside the project root and within standard
306 ;; lein source directories ("src", "test", "resources", "doc", "project.clj").
307 ;; However, this protection can be overridden with metadata on the :clean-targets
308 ;; vector - ^{:protect false}
e50be00 @technomancy Rearrange sample.project.clj.
authored
309 :clean-targets [:target-path :compile-path :foobar-paths
310 [:baz-config :qux-path] "out"]
1995275 @technomancy Document :clean-non-project-classes and reword help output.
authored
311 ;; Workaround for http://dev.clojure.org/jira/browse/CLJ-322 by deleting
312 ;; compilation artifacts for namespaces that come from dependencies.
313 :clean-non-project-classes true
60a8ed8 @technomancy Clarify :checkout-deps-shares in sample.project.clj.
authored
314 ;; Paths to include on the classpath from each project in the
315 ;; checkouts/ directory. (See the FAQ in the Readme for more details
316 ;; about checkout dependencies.) Set this to be a vector of
317 ;; functions that take the target project as argument. Defaults to
6e5dee8 @technomancy Update sample.project.clj docs.
authored
318 ;; [:source-paths :compile-path :resource-paths], but you could use
60a8ed8 @technomancy Clarify :checkout-deps-shares in sample.project.clj.
authored
319 ;; the following to share code from the test suite:
6e5dee8 @technomancy Update sample.project.clj docs.
authored
320 :checkout-deps-shares [:source-paths :test-paths
60a8ed8 @technomancy Clarify :checkout-deps-shares in sample.project.clj.
authored
321 ~(fn [p] (str (:root p) "/lib/dev/*"))]
e50be00 @technomancy Rearrange sample.project.clj.
authored
322
8b98d68 @technomancy Default to warning when version ranges are present.
authored
323 ;;; Testing
683bdff @michaelklishin Correct :test-selectors example
michaelklishin authored
324 ;; Predicates to determine whether to run a test or not, take test metadata
9718597 @technomancy Update sample.project.clj and NEWS.md.
authored
325 ;; as argument. See `lein help tutorial` for more information.
683bdff @michaelklishin Correct :test-selectors example
michaelklishin authored
326 :test-selectors {:default (fn [m] (not (or (:integration m) (:regression m))))
ab0b885 @technomancy Mention :test-selectors in sample.project.clj.
authored
327 :integration :integration
328 :regression :regression}
824552e @technomancy Support disabling :monkeypatch-clojure-test.
authored
329 ;; In order to support the `retest` task, Leiningen must monkeypatch the
330 ;; clojure.test library. This disables that feature and breaks `lein retest`.
331 :monkeypatch-clojure-test false
e50be00 @technomancy Rearrange sample.project.clj.
authored
332
8b98d68 @technomancy Default to warning when version ranges are present.
authored
333 ;;; Repl
6de6b8c @daemianmack Fix typos.
daemianmack authored
334 ;; Options to change the way the REPL behaves.
8b98d68 @technomancy Default to warning when version ranges are present.
authored
335 :repl-options { ;; Specify the string to print when prompting for input.
b48eec9 @trptcolin Handle starting in a different ns
trptcolin authored
336 ;; defaults to something like (fn [ns] (str *ns* "=> "))
337 :prompt (fn [ns] (str "your command for <" ns ">, master? " ))
722afb9 @technomancy Support custom repl :welcome message.
authored
338 ;; What to print when the repl session starts.
339 :welcome (println "Welcome to the magical world of the repl!")
b48eec9 @trptcolin Handle starting in a different ns
trptcolin authored
340 ;; Specify the ns to start the REPL in (overrides :main in
341 ;; this case only)
342 :init-ns foo.bar
343 ;; This expression will run when first opening a REPL, in the
6de6b8c @daemianmack Fix typos.
daemianmack authored
344 ;; namespace from :init-ns or :main if specified.
b48eec9 @trptcolin Handle starting in a different ns
trptcolin authored
345 :init (println "here we are in" *ns*)
07f2995 @technomancy Document :repl-options :caught. Refs #799.
authored
346 ;; Print stack traces on exceptions (highly recommended, but
347 ;; currently overwrites *1, *2, etc).
3addf52 @technomancy Auto-require namespace from :repl-options :caught.
authored
348 :caught clj-stacktrace.repl/pst+
17ba59a @gfredericks Document reply's :skip-default-init option
gfredericks authored
349 ;; Skip's the default requires and printed help message.
350 :skip-default-init false
c6697f7 @dakrone Collapse all repl-* options into :repl-options map
dakrone authored
351 ;; Customize the socket the repl task listens on and
352 ;; attaches to.
353 :host "0.0.0.0"
354 :port 4001
355 ;; If nREPL takes too long to load it may timeout,
356 ;; increase this to wait longer before timing out.
357 ;; Defaults to 30000 (30 seconds)
dbb7ca8 @cemerick * upgrade to nREPL 0.2.0-beta9
cemerick authored
358 :timeout 40000
359 ;; nREPL server customization
360 ;; Only one of #{:nrepl-handler :nrepl-middleware}
6de6b8c @daemianmack Fix typos.
daemianmack authored
361 ;; may be used at a time.
362 ;; Use a different server-side nREPL handler.
dbb7ca8 @cemerick * upgrade to nREPL 0.2.0-beta9
cemerick authored
363 :nrepl-handler (clojure.tools.nrepl.server/default-handler)
6de6b8c @daemianmack Fix typos.
daemianmack authored
364 ;; Add server-side middleware to nREPL stack.
d590f0c @technomancy Trim long lines in sample.project.clj.
authored
365 :nrepl-middleware [my.nrepl.thing/wrap-amazingness
6de6b8c @daemianmack Fix typos.
daemianmack authored
366 ;; TODO: link to more detailed documentation.
367 ;; Middleware without appropriate metadata
dbb7ca8 @cemerick * upgrade to nREPL 0.2.0-beta9
cemerick authored
368 ;; (see clojure.tools.nrepl.middleware/set-descriptor!
369 ;; for details) will simply be appended to the stack
370 ;; of middleware (rather than ordered based on its
6de6b8c @daemianmack Fix typos.
daemianmack authored
371 ;; expectations and requirements).
dbb7ca8 @cemerick * upgrade to nREPL 0.2.0-beta9
cemerick authored
372 (fn [handler]
373 (fn [& args]
374 (prn :middle args)
375 (apply handler args)))]}
e50be00 @technomancy Rearrange sample.project.clj.
authored
376
8b98d68 @technomancy Default to warning when version ranges are present.
authored
377 ;;; Jar Output
962ce20 @technomancy Scope :compile-path and :native-path under :target-path.
authored
378 ;; Name of the jar file produced. Will be placed inside :target-path.
379 ;; Including %s will splice the project version into the filename.
380 :jar-name "sample.jar"
381 ;; As above, but for uberjar.
382 :uberjar-name "sample-standalone.jar"
6de6b8c @daemianmack Fix typos.
daemianmack authored
383 ;; Leave the contents of :source-paths out of jars (for AOT projects).
0e189a8 @technomancy Add :omit-source option to leave files in :source-path out of jars.
authored
384 :omit-source true
6de6b8c @daemianmack Fix typos.
daemianmack authored
385 ;; Files with names matching any of these patterns will be excluded from jars.
acc9a82 @technomancy Specify what file patterns to exclude from jars. Thanks to Zehua Liu.
authored
386 :jar-exclusions [#"(?:^|/).svn/"]
2bda774 @technomancy Add :uberjar-exclusions to project.clj.
authored
387 ;; Same thing, but for uberjars.
388 :uberjar-exclusions [#"META-INF/DUMMY.SF"]
a2592ba @technomancy Move :auto-clean to jar task.
authored
389 ;; By default Leiningen will run a clean before creating jars to prevent
4776eeb @technomancy Add auto-clean to deploy task. Fixes #1512.
authored
390 ;; undeclared AOT from leaking to downstream consumers; this disables
391 ;; that behaviour.
392 :auto-clean false
39e3d57 @llasram Implement `:uberjar-merge-with` requested in issue #973.
llasram authored
393 ;; Files to merge programmatically in uberjars when multiple same-named files
394 ;; exist across project and dependencies. Should be a map of filename strings
395 ;; or regular expressions to a sequence of three functions:
396 ;; 1. Takes an input stream; returns a parsed datum.
397 ;; 2. Takes a new datum and the current result datum; returns a merged datum.
398 ;; 3. Takes an output stream and a datum; writes the datum to the stream.
399 ;; Resolved in reverse dependency order, starting with project.
400 :uberjar-merge-with {#"\.properties$" [slurp str spit]}
03d6632 @technomancy Document :filespecs in sample project.clj.
authored
401 ;; Add arbitrary jar entries. Supports :path, :paths, :bytes, and :fn types.
402 :filespecs [{:type :path :path "config/base.clj"}
6de6b8c @daemianmack Fix typos.
daemianmack authored
403 ;; Directory paths are included recursively.
03d6632 @technomancy Document :filespecs in sample project.clj.
authored
404 {:type :paths :paths ["config/web" "config/cli"]}
6de6b8c @daemianmack Fix typos.
daemianmack authored
405 ;; Programmatically-generated content can use :bytes.
03d6632 @technomancy Document :filespecs in sample project.clj.
authored
406 {:type :bytes :path "project.clj"
6de6b8c @daemianmack Fix typos.
daemianmack authored
407 ;; Strings or byte arrays are accepted.
03d6632 @technomancy Document :filespecs in sample project.clj.
authored
408 :bytes ~(slurp "project.clj")}
409 ;; :fn filespecs take the project as an argument and
410 ;; should return a filespec map of one of the other types.
411 {:type :fn :fn (fn [p]
412 {:type :bytes :path "git-log"
413 :bytes (:out (clojure.java.shell/sh
414 "git" "log" "-n" "1"))})}]
72c0d04 @circlespainter Manifest sections example & doc
circlespainter authored
415 ;; Set arbitrary key/value pairs for the jar's manifest. Any
416 ;; vector or sequence of pairs is supported as well.
0016f04 @technomancy Allow :manifest entries to contain functions.
authored
417 :manifest {"Project-awesome-level" "super-great"
6de6b8c @daemianmack Fix typos.
daemianmack authored
418 ;; Function values will be called with the project as an argument.
0016f04 @technomancy Allow :manifest entries to contain functions.
authored
419 "Class-Path" ~#(clojure.string/join
3654228 @technomancy Use space in sample for classpath.
authored
420 \space
0016f04 @technomancy Allow :manifest entries to contain functions.
authored
421 (leiningen.core.classpath/get-classpath %))
72c0d04 @circlespainter Manifest sections example & doc
circlespainter authored
422 ;; If a value is a collection, a manifest section is built for it and
423 ;; the name of the key is used as the section name.
424 :my-section-1 [["MyKey1" "MyValue1"] ["MyKey2" "MyValue2"]]
425 :my-section-2 {"MyKey3" "MyValue3" "MyKey4" "MyValue4"}
6de6b8c @daemianmack Fix typos.
daemianmack authored
426 ;; Symbol values will be resolved to find a function to call.
0016f04 @technomancy Allow :manifest entries to contain functions.
authored
427 "Grunge-level" my.plugin/calculate-grunginess}
e50be00 @technomancy Rearrange sample.project.clj.
authored
428
8b98d68 @technomancy Default to warning when version ranges are present.
authored
429 ;;; Pom Output
ce5fef4 @jcrossley3 Add a :pom-location option to fix #1541
jcrossley3 authored
430 ;; Where the pom.xml is written. If not set, the project root.
431 :pom-location "target/"
9718597 @technomancy Update sample.project.clj and NEWS.md.
authored
432 ;; Set parent for working within a multi-module maven project.
ef2b0f0 @xeqi Copy pom.xml generation from depot
xeqi authored
433 :parent [org.example/parent "0.0.1" :relative-path "../parent/pom.xml"]
c7f7867 @technomancy Clarify that :extensions aren't used by Leiningen. Fixes #555.
authored
434 ;; Extensions here will be propagated to the pom but not used by Leiningen.
ef2b0f0 @xeqi Copy pom.xml generation from depot
xeqi authored
435 :extensions [[org.apache.maven.wagon/wagon-webdav "1.0-beta-2"]
0bd7ab2 @winks Add :scm to sample.project.clj (#640)
winks authored
436 [foo/bar-baz "1.0"]]
9718597 @technomancy Update sample.project.clj and NEWS.md.
authored
437 ;; Plugins here will be propagated to the pom but not used by Leiningen.
1ab4cbc @llasram Fix unusual/extra whitespace in sample.project.clj.
llasram authored
438 :pom-plugins [[com.theoryinpractise/clojure-maven-plugin "1.3.13"
9718597 @technomancy Update sample.project.clj and NEWS.md.
authored
439 ;; this section is optional, values have the same syntax as pom-addition
440 {:configuration [:sourceDirectories [:sourceDirectory "src"]]
441 :extensions "true"
442 :executions ([:execution [:id "echodir"]
443 [:goals ([:goal "run"])]
444 [:phase "verify"]])}]
1ab4cbc @llasram Fix unusual/extra whitespace in sample.project.clj.
llasram authored
445 [org.apache.tomcat.maven/tomcat7-maven-plugin "2.1"]]
5d40f19 @technomancy Add environment variables reference to the bottom of sample.project.clj.
authored
446 ;; Include <scm> tag in generated pom.xml file. All key/value pairs
447 ;; appear exactly as configured. If absent, Leiningen will try to
448 ;; use information from a .git directory.
80cf398 @dgrnbrg Allow project's git repository to be different than project root
dgrnbrg authored
449 :scm {:name "git"
450 :tag "098afd745bcd"
451 :url "http://127.0.0.1/git/my-project"
452 ;; Allows you to use a repository in a different directory than the
453 ;; project's root, for instance, if you had multiple projects in a
454 ;; single git repository.
455 :dir ".."}
be6b511 @technomancy Mention pom XML still needs to validate.
authored
456 ;; Include xml in generated pom.xml file, as parsed by
457 ;; clojure.data.xml/sexp-as-element. Resulting pom still needs to
458 ;; validate according to the pom XML schema.
c43951c @technomancy Better explanation of :pom-addition, a few more env vars in sample.
authored
459 :pom-addition [:developers [:developer {:id "benbit"}
460 [:name "Ben Bitdiddle"]
e55d98a @Raynes Add examples of new keys to sample.project.clj.
Raynes authored
461 [:url "http://www.example.com/benjamin"]]]
462
8b98d68 @technomancy Default to warning when version ranges are present.
authored
463 ;;; Safety flags
e55d98a @Raynes Add examples of new keys to sample.project.clj.
Raynes authored
464 ;; Indicate whether or not `lein install` should abort when trying to install
465 ;; releases. When false, trying to run `lein install` in a project with a version
466 ;; that isn't a snapshot will cause leiningen to abort with a descriptive error
467 ;; message.
468 :install-releases? false
469 ;; Dictate which git branches deploys should be allowed from. When set,
470 ;; `lein deploy` will only work from the git branches included and will
471 ;; abort otherwise.
472 :deploy-branches ["master"])
5d40f19 @technomancy Add environment variables reference to the bottom of sample.project.clj.
authored
473
474 ;;; Environment Variables used by Leiningen
475
476 ;; JAVA_CMD - executable to use for java(1)
477 ;; JVM_OPTS - extra options to pass to the java command
478 ;; DEBUG - increased verbosity
88ce99b @technomancy Update NEWS.md.
authored
479 ;; LEIN_SILENT - suppress info-level output
d4d6548 @technomancy Fix link in DEPLOY.md to use preview branch. Fixes #862.
authored
480 ;; LEIN_HOME - directory in which to look for user settings
5d40f19 @technomancy Add environment variables reference to the bottom of sample.project.clj.
authored
481 ;; LEIN_SNAPSHOTS_IN_RELEASE - allow releases to depend on snapshots
492bec0 @hyPiRion Document LEIN_JVM_OPTS. Closes #1261.
hyPiRion authored
482 ;; LEIN_JVM_OPTS - tweak speed of plugins or fix compatibility with old Java versions
e7474a8 @technomancy Update env var reference.
authored
483 ;; LEIN_REPL_HOST - interface on which to connect to nREPL server
484 ;; LEIN_REPL_PORT - port on which to start or connect to nREPL server
c43951c @technomancy Better explanation of :pom-addition, a few more env vars in sample.
authored
485 ;; LEIN_OFFLINE - equivalent of :offline? true but works for plugins
486 ;; LEIN_GPG - gpg executable to use for encryption/signing
4e77b0d @hyPiRion Change line endings for `lein new` on Windows.
hyPiRion authored
487 ;; LEIN_NEW_UNIX_NEWLINES - ensure that `lein new` emits '\n' as newlines
9718597 @technomancy Update sample.project.clj and NEWS.md.
authored
488 ;; LEIN_SUPPRESS_USER_LEVEL_REPO_WARNINGS - suppress "repository in user profile" warnings
489 ;; LEIN_FAST_TRAMPOLINE - memoize `java` invocation command to speed up subsequent trampoline launches
3dc207f @hugoduncan Add LEIN_NO_USER_PROFILES to sample.project.clj
hugoduncan authored
490 ;; LEIN_NO_USER_PROFILES - suppress loading of user and system profiles
5d40f19 @technomancy Add environment variables reference to the bottom of sample.project.clj.
authored
491 ;; http_proxy - host and port to proxy HTTP connections through
e7474a8 @technomancy Update env var reference.
authored
492 ;; http_no_proxy - pipe-separated list of hosts which may be accessed directly
Something went wrong with that request. Please try again.