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