Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 224 lines (220 sloc) 13.065 kB
915e61a @technomancy Add sample.project.clj showing all honored project keys.
authored
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
19b4464 @technomancy Rework some of sample.project.clj.
authored
4 ;; representative configuration. For a more detailed explanation of
5 ;; some of the terms 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
19b4464 @technomancy Rework some of sample.project.clj.
authored
14 ;; The descrption text is searchable from repositories like Clojars.
915e61a @technomancy Add sample.project.clj showing all honored project keys.
authored
15 :description "A sample project"
16 :url "http://example.org/sample-clojure-project"
3b44549 @michalmarczyk Documented :mailing-list and :license in sample.project.clj.
michalmarczyk authored
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"
c43ee75 @technomancy Trim long lines.
authored
22 :other-archives ["http://example.org/sample-list-archive2"
23 "http://example.org/sample-list-archive3"]
3b44549 @michalmarczyk Documented :mailing-list and :license in sample.project.clj.
michalmarczyk authored
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
19b4464 @technomancy Rework some of sample.project.clj.
authored
29 ;; artifacts. A seq of :licenses is also supported.
3b44549 @michalmarczyk Documented :mailing-list and :license in sample.project.clj.
michalmarczyk authored
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"}
915e61a @technomancy Add sample.project.clj showing all honored project keys.
authored
34 ;; Dependencies are listed as [group-id/name version].
4ef309b @technomancy Update sample.project.clj for 2.0.0-preview.
authored
35 :dependencies [[org.clojure/clojure "1.3.0"]
7c82e59 @technomancy Mention new `:dependencies` settings in sample.project.clj. Fixes #501.
authored
36 [org.jclouds/jclouds "1.0" :classifier "jdk15" :scope "test"]
a8c06fb @xeqi Change :type to :extension in sample. Fixes #457
xeqi authored
37 [net.sf.ehcache/ehcache "2.3.1" :extension "pom"]
7c82e59 @technomancy Mention new `:dependencies` settings in sample.project.clj. Fixes #501.
authored
38 [log4j "1.2.15" :exclusions [[javax.mail/mail :extension "jar"]
39 [javax.jms/jms :classifier "*"]
915e61a @technomancy Add sample.project.clj showing all honored project keys.
authored
40 com.sun.jdmk/jmxtools
41 com.sun.jmx/jmxri]]]
ac9f135 @joegallo Add global :exclusions
joegallo authored
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]
6e5dee8 @technomancy Update sample.project.clj docs.
authored
46 ;; Plugins are code that runs in Leiningen itself and usually
47 ;; provides new tasks or hooks.
4ef309b @technomancy Update sample.project.clj for 2.0.0-preview.
authored
48 :plugins [[lein-pprint "1.1.1"]
c7f7867 @technomancy Clarify that :extensions aren't used by Leiningen. Fixes #555.
authored
49 [lein-assoc "0.1.0"]
50 [s3-wagon-private "1.1.1"]]
2a089a1 @technomancy Document :certificates.
authored
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"]
4ef309b @technomancy Update sample.project.clj for 2.0.0-preview.
authored
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.
dff9a6c @technomancy Spin off separate profile guide from readme/tutorial.
authored
60 ;; See `lein help profiles` for a detailed explanation.
4ef309b @technomancy Update sample.project.clj for 2.0.0-preview.
authored
61 :profiles {:dev {:resource-paths ["dummy-data"]
62 :dependencies [[clj-stacktrace "0.2.4"]]}
63 :debug {:debug true
21d9917 @technomancy Now :project-init is redundant with :injections.
authored
64 :injections [(prn (into {} (System/getProperties)))]}
4ef309b @technomancy Update sample.project.clj for 2.0.0-preview.
authored
65 :1.4 {:dependencies [[org.clojure/clojure "1.4.0-alpha1"]]}}
7c82e59 @technomancy Mention new `:dependencies` settings in sample.project.clj. Fixes #501.
authored
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
70 ;; "lein assoc :magic true run -m hi.core".
4ef309b @technomancy Update sample.project.clj for 2.0.0-preview.
authored
71 :aliases {"launch" "run"
72 "with-magic" ["assoc" ":magic" "true"]}
7c82e59 @technomancy Mention new `:dependencies` settings in sample.project.clj. Fixes #501.
authored
73 ;; Normally Leiningen runs the javac and compile tasks before
74 ;; calling any eval-in-project code, but you can override this with
75 ;; the :prep-tasks key to do other things like compile protocol buffers.
76 :prep-tasks ["protoc" "compile"]
a466709 @technomancy Minor cleanup of :min-lein-version functions.
authored
77 ;; Warns users of earlier versions of Leiningen.
4ef309b @technomancy Update sample.project.clj for 2.0.0-preview.
authored
78 :min-lein-version "2.0.0"
60a8ed8 @technomancy Clarify :checkout-deps-shares in sample.project.clj.
authored
79 ;; Paths to include on the classpath from each project in the
80 ;; checkouts/ directory. (See the FAQ in the Readme for more details
81 ;; about checkout dependencies.) Set this to be a vector of
82 ;; functions that take the target project as argument. Defaults to
6e5dee8 @technomancy Update sample.project.clj docs.
authored
83 ;; [:source-paths :compile-path :resource-paths], but you could use
60a8ed8 @technomancy Clarify :checkout-deps-shares in sample.project.clj.
authored
84 ;; the following to share code from the test suite:
6e5dee8 @technomancy Update sample.project.clj docs.
authored
85 :checkout-deps-shares [:source-paths :test-paths
60a8ed8 @technomancy Clarify :checkout-deps-shares in sample.project.clj.
authored
86 ~(fn [p] (str (:root p) "/lib/dev/*"))]
4ef309b @technomancy Update sample.project.clj for 2.0.0-preview.
authored
87 ;; Load these namespaces on startup to pick up hooks from them.
b5cb0cb @technomancy Don't load hooks unless they're specified in project.clj.
authored
88 :hooks [leiningen.hooks.difftest]
ab0b885 @technomancy Mention :test-selectors in sample.project.clj.
authored
89 ;; Predicates to determine whether to run a test or not. See tutorial.
90 :test-selectors {:default (fn [t] (not (or (:integration v) (:regression v))))
91 :integration :integration
92 :regression :regression}
915e61a @technomancy Add sample.project.clj showing all honored project keys.
authored
93 ;; These namespaces will be AOT-compiled. Needed for gen-class and
6e5dee8 @technomancy Update sample.project.clj docs.
authored
94 ;; other Java interop functionality. Put a regex here to compile all
95 ;; namespaces whose names match.
15ff6b1 @technomancy A few doc changes.
authored
96 :aot [org.example.sample]
c52f044 @technomancy Documentation updates preparing for 1.3.1.
authored
97 ;; The -main function in this namespace will be run at launch if you
6e5dee8 @technomancy Update sample.project.clj docs.
authored
98 ;; create an uberjar. Set :skip-aot metadata on this symbol to use
99 ;; it for other things like the run task or shell wrappers without
100 ;; bringing in AOT if you don't need an executable uberjar.
c865d4d @technomancy Fix :main example in sample.project.clj.
authored
101 :main org.example.sample
c6697f7 @dakrone Collapse all repl-* options into :repl-options map
dakrone authored
102 ;; Options to change the way the REPL behaves
b48eec9 @trptcolin Handle starting in a different ns
trptcolin authored
103 :repl-options {;; Specify the string to print when prompting for input.
104 ;; defaults to something like (fn [ns] (str *ns* "=> "))
105 :prompt (fn [ns] (str "your command for <" ns ">, master? " ))
106 ;; Specify the ns to start the REPL in (overrides :main in
107 ;; this case only)
108 :init-ns foo.bar
109 ;; This expression will run when first opening a REPL, in the
110 ;; namespace from :init-ns or :main if specified
111 :init (println "here we are in" *ns*)
c6697f7 @dakrone Collapse all repl-* options into :repl-options map
dakrone authored
112 ;; Customize the socket the repl task listens on and
113 ;; attaches to.
114 :host "0.0.0.0"
115 :port 4001
116 ;; If nREPL takes too long to load it may timeout,
117 ;; increase this to wait longer before timing out.
118 ;; Defaults to 30000 (30 seconds)
119 :timeout 40000}
21d9917 @technomancy Now :project-init is redundant with :injections.
authored
120 ;; Forms to prepend to every form that is evaluated inside your project.
4ef309b @technomancy Update sample.project.clj for 2.0.0-preview.
authored
121 ;; Allows working around the Gilardi Scenario: http://technomancy.us/143
21d9917 @technomancy Now :project-init is redundant with :injections.
authored
122 :injections [(require 'clojure.pprint)]
915e61a @technomancy Add sample.project.clj showing all honored project keys.
authored
123 ;; Emit warnings on all reflection calls.
124 :warn-on-reflection true
4ef309b @technomancy Update sample.project.clj for 2.0.0-preview.
authored
125 ;; Set this in order to only use the :repositories you list below.
915e61a @technomancy Add sample.project.clj showing all honored project keys.
authored
126 :omit-default-repositories true
4ef309b @technomancy Update sample.project.clj for 2.0.0-preview.
authored
127 ;; These repositories will be searched for :dependencies and
128 ;; :plugins and will also be available to deploy to.
129 :repositories {"java.net" "http://download.java.net/maven/2"
130 "sonatype"
131 {:url "http://oss.sonatype.org/content/repositories/releases"
132 ;; If a repository contains releases only; setting :snapshots
133 ;; to false will speed up dependency checking.
134 :snapshots false
135 ;; You can also set the policies for how to handle :checksum
136 ;; failures to :fail, :warn, or :ignore. In :releases, :daily,
137 ;; :always, and :never are supported.
176bcf5 @technomancy Add :update support at the top-level of the project map.
authored
138 :releases {:checksum :fail :update :always}
139 ;; You can set :checksum and :update here for them
140 ;; to apply to both :releases and :snapshots:
141 :update :always, :checksum :fail}
fc7ad70 @technomancy Add more :repositories settings details to sample project.clj.
authored
142 ;; Repositories named "snapshots" and "releases" automatically
143 ;; have their :snapshots and :releases disabled as appropriate.
4ef309b @technomancy Update sample.project.clj for 2.0.0-preview.
authored
144 ;; Credentials for repositories should *not* be stored
145 ;; in project.clj but in ~/.lein/profiles.clj instead:
146 ;; {:auth {:repository-auth {#"http://blueant.com/archiva/"
147 ;; {:username "milgrim"
148 ;; :password "locative.1"}}}}
149 "snapshots" "http://blueant.com/archiva/snapshots"
674b4d5 @technomancy Replace :env values in :repositories with lookups from environment.
authored
150 "releases" {:url "http://blueant.com/archiva/internal"
151 ;; Using :env as a value here will cause an
152 ;; enironment variable to be used based on
153 ;; the key; in this case LEIN_PASSWORD.
154 :username "milgrim" :password :env}}
176bcf5 @technomancy Add :update support at the top-level of the project map.
authored
155 ;; You can set :update and :checksum policies here to have them
7d64102 @technomancy Allow :checksum policy to be set at the top-level of project.clj as w…
authored
156 ;; apply for all :repositories. Usually you will not set :update
176bcf5 @technomancy Add :update support at the top-level of the project map.
authored
157 ;; directly but apply the "update" profile instead.
158 :update :always
bd6959c @cemerick Add support for :deploy-repositories slot for deployment-only reposit…
cemerick authored
159 ;; the deploy task will give preference to repositories specified in
160 ;; :deploy-repositories, and repos listed there will not be used for
4ef309b @technomancy Update sample.project.clj for 2.0.0-preview.
authored
161 ;; dependency resolution.
162 :deploy-repositories {"releases" "http://blueant.com/archiva/internal/releases"
163 "snapshots" "http://blueant.com/archiva/internal/snapshots"}
a62ff25 @technomancy Update sample, readme, todo.
authored
164 ;; Prevent Leiningen from checking the network for dependencies.
165 ;; This wouldn't normally be set in project.clj; it would come from a profile.
166 :offline? true
167 ;; Override the location of the local maven repository.
168 :local-repo "/home/dude/.lein/repo"
915e61a @technomancy Add sample.project.clj showing all honored project keys.
authored
169 ;; If you'd rather use a different directory structure, you can set these.
4ef309b @technomancy Update sample.project.clj for 2.0.0-preview.
authored
170 ;; Paths that contain "inputs" are vectors, "outputs" are strings.
171 :source-paths ["src" "src/main/clojure"]
6e5dee8 @technomancy Update sample.project.clj docs.
authored
172 :java-source-paths ["src/main/java"] ; Java source is stored separately.
4ef309b @technomancy Update sample.project.clj for 2.0.0-preview.
authored
173 :test-paths ["test" "src/test/clojure"]
174 :resource-paths ["src/main/resource"] ; non-code files included in classpath/jar
6e5dee8 @technomancy Update sample.project.clj docs.
authored
175 :compile-path "target/classes" ; for .class files
39a6b2c @technomancy Remove Clojure 1.2 from bootclasspath in lein.bat. Might fix #486.
authored
176 :native-path "src/native" ; where to extract native dependencies
5458e65 @dysinger Make the sample file match the code
dysinger authored
177 :target-path "target/" ; where to place the project's jar file
18becb7 @technomancy Add :extra-classpath-dirs to project classpaths.
authored
178 :jar-name "sample.jar" ; name of the jar produced by 'lein jar'
ae72f2d @michalmarczyk Documented :jar-name & :uberjar-name in sample.project.clj.
michalmarczyk authored
179 :uberjar-name "sample-standalone.jar" ; as above for uberjar
19b4464 @technomancy Rework some of sample.project.clj.
authored
180 ;; Options to pass to java compiler for java source
0f1f6df @technomancy Replace :javac-options map with vector. Fixes #450.
authored
181 :javac-options [:destdir "classes/"]
6e5dee8 @technomancy Update sample.project.clj docs.
authored
182 ;; 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
183 :omit-source true
acc9a82 @technomancy Specify what file patterns to exclude from jars. Thanks to Zehua Liu.
authored
184 ;; Files with names matching any of these patterns will be excluded from jars
185 :jar-exclusions [#"(?:^|/).svn/"]
2bda774 @technomancy Add :uberjar-exclusions to project.clj.
authored
186 ;; Same thing, but for uberjars.
187 :uberjar-exclusions [#"META-INF/DUMMY.SF"]
03d6632 @technomancy Document :filespecs in sample project.clj.
authored
188 ;; Add arbitrary jar entries. Supports :path, :paths, :bytes, and :fn types.
189 :filespecs [{:type :path :path "config/base.clj"}
190 ;; directory paths are included recursively
191 {:type :paths :paths ["config/web" "config/cli"]}
192 ;; programmatically-generated content can use :bytes
193 {:type :bytes :path "project.clj"
194 ;; strings or byte arrays are accepted
195 :bytes ~(slurp "project.clj")}
196 ;; :fn filespecs take the project as an argument and
197 ;; should return a filespec map of one of the other types.
198 {:type :fn :fn (fn [p]
199 {:type :bytes :path "git-log"
200 :bytes (:out (clojure.java.shell/sh
201 "git" "log" "-n" "1"))})}]
0966229 @technomancy Clean up make-manifest. Fixes #46.
authored
202 ;; Set arbitrary key/value pairs for the jar's manifest.
0016f04 @technomancy Allow :manifest entries to contain functions.
authored
203 :manifest {"Project-awesome-level" "super-great"
204 ;; function values will be called with the project as an argument.
205 "Class-Path" ~#(clojure.string/join
3654228 @technomancy Use space in sample for classpath.
authored
206 \space
0016f04 @technomancy Allow :manifest entries to contain functions.
authored
207 (leiningen.core.classpath/get-classpath %))
208 ;; symbol values will be resolved to find a function to call.
209 "Grunge-level" my.plugin/calculate-grunginess}
915e61a @technomancy Add sample.project.clj showing all honored project keys.
authored
210 ;; You can set JVM-level options here.
f732bfe @technomancy Support :eval-in-leiningen key in project.clj for plugins.
authored
211 :jvm-opts ["-Xmx1g"]
6e5dee8 @technomancy Update sample.project.clj docs.
authored
212 ;; Control the context in which your project code is evaluated.
213 ;; Defaults to :subprocess, but can also be :leiningen (for plugins)
214 ;; or :classloader (experimental) to avoid starting a subprocess.
215 :eval-in :leiningen
c263783 @technomancy Turn :bootclasspath off by default; too many issues for now.
authored
216 ;; Enable bootclasspath optimization. This improves boot time but interferes
2f2bd69 @technomancy Fix tests for bootclasspath.
authored
217 ;; with using things like pomegranate at runtime and using Clojure 1.2.
c263783 @technomancy Turn :bootclasspath off by default; too many issues for now.
authored
218 :bootclasspath true
07a755c @gmwils Add :parent to sample.project.clj
gmwils authored
219 ;; Set parent for working with in a multi-module maven project
ef2b0f0 @xeqi Copy pom.xml generation from depot
xeqi authored
220 :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
221 ;; Extensions here will be propagated to the pom but not used by Leiningen.
ef2b0f0 @xeqi Copy pom.xml generation from depot
xeqi authored
222 :extensions [[org.apache.maven.wagon/wagon-webdav "1.0-beta-2"]
223 [foo/bar-baz "1.0"]])
Something went wrong with that request. Please try again.