Skip to content

HTTPS clone URL

Subversion checkout URL

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