Skip to content
This repository
Newer
Older
100644 196 lines (193 sloc) 11.389 kb
915e61a8 »
2010-06-05 Add sample.project.clj showing all honored project keys.
1 ;; This is an annotated example of the options that may be set in a
2 ;; project.clj file. It is a fairly contrived example in order to
3 ;; cover all options exhaustively; it shouldn't be considered a
19b44647 »
2010-12-24 Rework some of sample.project.clj.
4 ;; representative configuration. For a more detailed explanation of
5 ;; some of the terms run "lein help tutorial".
915e61a8 »
2010-06-05 Add sample.project.clj showing all honored project keys.
6
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"
3e7f75ee »
2010-06-24 Mention unquote in sample.project.clj
9 ;; Beyond this point you may prepend a form with unquote, or ~, to eval it.
10
19b44647 »
2010-12-24 Rework some of sample.project.clj.
11 ;; The descrption text is searchable from repositories like Clojars.
915e61a8 »
2010-06-05 Add sample.project.clj showing all honored project keys.
12 :description "A sample project"
13 :url "http://example.org/sample-clojure-project"
3b445493 »
2010-06-17 Documented :mailing-list and :license in sample.project.clj.
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"
c43ee751 »
2010-07-12 Trim long lines.
19 :other-archives ["http://example.org/sample-list-archive2"
20 "http://example.org/sample-list-archive3"]
3b445493 »
2010-06-17 Documented :mailing-list and :license in sample.project.clj.
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
19b44647 »
2010-12-24 Rework some of sample.project.clj.
26 ;; artifacts. A seq of :licenses is also supported.
3b445493 »
2010-06-17 Documented :mailing-list and :license in sample.project.clj.
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"}
915e61a8 »
2010-06-05 Add sample.project.clj showing all honored project keys.
31 ;; Dependencies are listed as [group-id/name version].
4ef309b4 »
2012-03-05 Update sample.project.clj for 2.0.0-preview.
32 :dependencies [[org.clojure/clojure "1.3.0"]
7c82e59a »
2012-04-09 Mention new `:dependencies` settings in sample.project.clj. Fixes #501.
33 [org.jclouds/jclouds "1.0" :classifier "jdk15" :scope "test"]
a8c06fbc »
2012-03-29 Change :type to :extension in sample. Fixes #457
34 [net.sf.ehcache/ehcache "2.3.1" :extension "pom"]
7c82e59a »
2012-04-09 Mention new `:dependencies` settings in sample.project.clj. Fixes #501.
35 [log4j "1.2.15" :exclusions [[javax.mail/mail :extension "jar"]
36 [javax.jms/jms :classifier "*"]
915e61a8 »
2010-06-05 Add sample.project.clj showing all honored project keys.
37 com.sun.jdmk/jmxtools
38 com.sun.jmx/jmxri]]]
ac9f135c »
2011-03-11 Add global :exclusions
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]
6e5dee86 »
2012-04-10 Update sample.project.clj docs.
43 ;; Plugins are code that runs in Leiningen itself and usually
44 ;; provides new tasks or hooks.
4ef309b4 »
2012-03-05 Update sample.project.clj for 2.0.0-preview.
45 :plugins [[lein-pprint "1.1.1"]
46 [lein-assoc "0.1.0"]]
47 ;; Each active profile gets merged into the project map. The :dev
48 ;; and :user profiles are active by default, but the latter should be
49 ;; looked up in ~/.lein/profiles.clj rather than set in project.clj.
50 ;; Use the with-profiles higher-order task to run a task with a
51 ;; different set of active profiles.
52 :profiles {:dev {:resource-paths ["dummy-data"]
53 :dependencies [[clj-stacktrace "0.2.4"]]}
54 :debug {:debug true
21d9917a »
2012-03-28 Now :project-init is redundant with :injections.
55 :injections [(prn (into {} (System/getProperties)))]}
4ef309b4 »
2012-03-05 Update sample.project.clj for 2.0.0-preview.
56 :1.4 {:dependencies [[org.clojure/clojure "1.4.0-alpha1"]]}}
7c82e59a »
2012-04-09 Mention new `:dependencies` settings in sample.project.clj. Fixes #501.
57 ;; Support project-specific task aliases. These are interpreted in
58 ;; the same way as command-line arguments to the lein command. If
59 ;; the alias points to a vector, it uses partial application. For
60 ;; example, "lein with-magic run -m hi.core" would be equivalent to
61 ;; "lein assoc :magic true run -m hi.core".
4ef309b4 »
2012-03-05 Update sample.project.clj for 2.0.0-preview.
62 :aliases {"launch" "run"
63 "with-magic" ["assoc" ":magic" "true"]}
7c82e59a »
2012-04-09 Mention new `:dependencies` settings in sample.project.clj. Fixes #501.
64 ;; Normally Leiningen runs the javac and compile tasks before
65 ;; calling any eval-in-project code, but you can override this with
66 ;; the :prep-tasks key to do other things like compile protocol buffers.
67 :prep-tasks ["protoc" "compile"]
a4667096 »
2010-08-23 Minor cleanup of :min-lein-version functions.
68 ;; Warns users of earlier versions of Leiningen.
4ef309b4 »
2012-03-05 Update sample.project.clj for 2.0.0-preview.
69 :min-lein-version "2.0.0"
60a8ed82 »
2011-07-05 Clarify :checkout-deps-shares in sample.project.clj.
70 ;; Paths to include on the classpath from each project in the
71 ;; checkouts/ directory. (See the FAQ in the Readme for more details
72 ;; about checkout dependencies.) Set this to be a vector of
73 ;; functions that take the target project as argument. Defaults to
6e5dee86 »
2012-04-10 Update sample.project.clj docs.
74 ;; [:source-paths :compile-path :resource-paths], but you could use
60a8ed82 »
2011-07-05 Clarify :checkout-deps-shares in sample.project.clj.
75 ;; the following to share code from the test suite:
6e5dee86 »
2012-04-10 Update sample.project.clj docs.
76 :checkout-deps-shares [:source-paths :test-paths
60a8ed82 »
2011-07-05 Clarify :checkout-deps-shares in sample.project.clj.
77 ~(fn [p] (str (:root p) "/lib/dev/*"))]
4ef309b4 »
2012-03-05 Update sample.project.clj for 2.0.0-preview.
78 ;; Load these namespaces on startup to pick up hooks from them.
b5cb0cb5 »
2010-07-30 Don't load hooks unless they're specified in project.clj.
79 :hooks [leiningen.hooks.difftest]
ab0b885a »
2010-11-24 Mention :test-selectors in sample.project.clj.
80 ;; Predicates to determine whether to run a test or not. See tutorial.
81 :test-selectors {:default (fn [t] (not (or (:integration v) (:regression v))))
82 :integration :integration
83 :regression :regression}
915e61a8 »
2010-06-05 Add sample.project.clj showing all honored project keys.
84 ;; These namespaces will be AOT-compiled. Needed for gen-class and
6e5dee86 »
2012-04-10 Update sample.project.clj docs.
85 ;; other Java interop functionality. Put a regex here to compile all
86 ;; namespaces whose names match.
15ff6b11 »
2011-01-24 A few doc changes.
87 :aot [org.example.sample]
c52f044e »
2010-09-05 Documentation updates preparing for 1.3.1.
88 ;; The -main function in this namespace will be run at launch if you
6e5dee86 »
2012-04-10 Update sample.project.clj docs.
89 ;; create an uberjar. Set :skip-aot metadata on this symbol to use
90 ;; it for other things like the run task or shell wrappers without
91 ;; bringing in AOT if you don't need an executable uberjar.
c865d4d0 »
2010-08-22 Fix :main example in sample.project.clj.
92 :main org.example.sample
c6697f76 »
2012-04-10 Collapse all repl-* options into :repl-options map
93 ;; Options to change the way the REPL behaves
b48eec97 »
2012-04-11 Handle starting in a different ns
94 :repl-options {;; Specify the string to print when prompting for input.
95 ;; defaults to something like (fn [ns] (str *ns* "=> "))
96 :prompt (fn [ns] (str "your command for <" ns ">, master? " ))
97 ;; Specify the ns to start the REPL in (overrides :main in
98 ;; this case only)
99 :init-ns foo.bar
100 ;; This expression will run when first opening a REPL, in the
101 ;; namespace from :init-ns or :main if specified
102 :init (println "here we are in" *ns*)
c6697f76 »
2012-04-10 Collapse all repl-* options into :repl-options map
103 ;; Customize the socket the repl task listens on and
104 ;; attaches to.
105 :host "0.0.0.0"
106 :port 4001
107 ;; If nREPL takes too long to load it may timeout,
108 ;; increase this to wait longer before timing out.
109 ;; Defaults to 30000 (30 seconds)
110 :timeout 40000}
21d9917a »
2012-03-28 Now :project-init is redundant with :injections.
111 ;; Forms to prepend to every form that is evaluated inside your project.
4ef309b4 »
2012-03-05 Update sample.project.clj for 2.0.0-preview.
112 ;; Allows working around the Gilardi Scenario: http://technomancy.us/143
21d9917a »
2012-03-28 Now :project-init is redundant with :injections.
113 :injections [(require 'clojure.pprint)]
915e61a8 »
2010-06-05 Add sample.project.clj showing all honored project keys.
114 ;; Emit warnings on all reflection calls.
115 :warn-on-reflection true
4ef309b4 »
2012-03-05 Update sample.project.clj for 2.0.0-preview.
116 ;; Set this in order to only use the :repositories you list below.
915e61a8 »
2010-06-05 Add sample.project.clj showing all honored project keys.
117 :omit-default-repositories true
4ef309b4 »
2012-03-05 Update sample.project.clj for 2.0.0-preview.
118 ;; These repositories will be searched for :dependencies and
119 ;; :plugins and will also be available to deploy to.
120 :repositories {"java.net" "http://download.java.net/maven/2"
121 "sonatype"
122 {:url "http://oss.sonatype.org/content/repositories/releases"
123 ;; If a repository contains releases only; setting :snapshots
124 ;; to false will speed up dependency checking.
125 :snapshots false
126 ;; You can also set the policies for how to handle :checksum
127 ;; failures to :fail, :warn, or :ignore. In :releases, :daily,
128 ;; :always, and :never are supported.
129 :releases {:checksum :fail :update :always}}
fc7ad701 »
2011-04-11 Add more :repositories settings details to sample project.clj.
130 ;; Repositories named "snapshots" and "releases" automatically
131 ;; have their :snapshots and :releases disabled as appropriate.
4ef309b4 »
2012-03-05 Update sample.project.clj for 2.0.0-preview.
132 ;; Credentials for repositories should *not* be stored
133 ;; in project.clj but in ~/.lein/profiles.clj instead:
134 ;; {:auth {:repository-auth {#"http://blueant.com/archiva/"
135 ;; {:username "milgrim"
136 ;; :password "locative.1"}}}}
137 "snapshots" "http://blueant.com/archiva/snapshots"
138 "releases" "http://blueant.com/archiva/internal"}
bd6959c3 »
2011-09-15 Add support for :deploy-repositories slot for deployment-only reposit…
139 ;; the deploy task will give preference to repositories specified in
140 ;; :deploy-repositories, and repos listed there will not be used for
4ef309b4 »
2012-03-05 Update sample.project.clj for 2.0.0-preview.
141 ;; dependency resolution.
142 :deploy-repositories {"releases" "http://blueant.com/archiva/internal/releases"
143 "snapshots" "http://blueant.com/archiva/internal/snapshots"}
a62ff253 »
2012-03-06 Update sample, readme, todo.
144 ;; Prevent Leiningen from checking the network for dependencies.
145 ;; This wouldn't normally be set in project.clj; it would come from a profile.
146 :offline? true
147 ;; Override the location of the local maven repository.
148 :local-repo "/home/dude/.lein/repo"
915e61a8 »
2010-06-05 Add sample.project.clj showing all honored project keys.
149 ;; If you'd rather use a different directory structure, you can set these.
4ef309b4 »
2012-03-05 Update sample.project.clj for 2.0.0-preview.
150 ;; Paths that contain "inputs" are vectors, "outputs" are strings.
151 :source-paths ["src" "src/main/clojure"]
6e5dee86 »
2012-04-10 Update sample.project.clj docs.
152 :java-source-paths ["src/main/java"] ; Java source is stored separately.
4ef309b4 »
2012-03-05 Update sample.project.clj for 2.0.0-preview.
153 :test-paths ["test" "src/test/clojure"]
154 :resource-paths ["src/main/resource"] ; non-code files included in classpath/jar
6e5dee86 »
2012-04-10 Update sample.project.clj docs.
155 :compile-path "target/classes" ; for .class files
39a6b2c6 »
2012-03-31 Remove Clojure 1.2 from bootclasspath in lein.bat. Might fix #486.
156 :native-path "src/native" ; where to extract native dependencies
5458e659 »
2012-03-24 Make the sample file match the code
157 :target-path "target/" ; where to place the project's jar file
18becb7a »
2011-04-22 Add :extra-classpath-dirs to project classpaths.
158 :jar-name "sample.jar" ; name of the jar produced by 'lein jar'
ae72f2db »
2010-06-24 Documented :jar-name & :uberjar-name in sample.project.clj.
159 :uberjar-name "sample-standalone.jar" ; as above for uberjar
19b44647 »
2010-12-24 Rework some of sample.project.clj.
160 ;; Options to pass to java compiler for java source
161 ;; See http://ant.apache.org/manual/Tasks/javac.html
0f1f6df4 »
2012-04-09 Replace :javac-options map with vector. Fixes #450.
162 :javac-options [:destdir "classes/"]
6e5dee86 »
2012-04-10 Update sample.project.clj docs.
163 ;; Leave the contents of :source-paths out of jars (for AOT projects)
0e189a8d »
2010-08-16 Add :omit-source option to leave files in :source-path out of jars.
164 :omit-source true
acc9a828 »
2010-09-23 Specify what file patterns to exclude from jars. Thanks to Zehua Liu.
165 ;; Files with names matching any of these patterns will be excluded from jars
166 :jar-exclusions [#"(?:^|/).svn/"]
2bda774e »
2010-11-20 Add :uberjar-exclusions to project.clj.
167 ;; Same thing, but for uberjars.
168 :uberjar-exclusions [#"META-INF/DUMMY.SF"]
03d66321 »
2012-04-03 Document :filespecs in sample project.clj.
169 ;; Add arbitrary jar entries. Supports :path, :paths, :bytes, and :fn types.
170 :filespecs [{:type :path :path "config/base.clj"}
171 ;; directory paths are included recursively
172 {:type :paths :paths ["config/web" "config/cli"]}
173 ;; programmatically-generated content can use :bytes
174 {:type :bytes :path "project.clj"
175 ;; strings or byte arrays are accepted
176 :bytes ~(slurp "project.clj")}
177 ;; :fn filespecs take the project as an argument and
178 ;; should return a filespec map of one of the other types.
179 {:type :fn :fn (fn [p]
180 {:type :bytes :path "git-log"
181 :bytes (:out (clojure.java.shell/sh
182 "git" "log" "-n" "1"))})}]
09662298 »
2010-08-08 Clean up make-manifest. Fixes #46.
183 ;; Set arbitrary key/value pairs for the jar's manifest.
184 :manifest {"Project-awesome-level" "super-great"}
915e61a8 »
2010-06-05 Add sample.project.clj showing all honored project keys.
185 ;; You can set JVM-level options here.
f732bfee »
2010-10-24 Support :eval-in-leiningen key in project.clj for plugins.
186 :jvm-opts ["-Xmx1g"]
6e5dee86 »
2012-04-10 Update sample.project.clj docs.
187 ;; Control the context in which your project code is evaluated.
188 ;; Defaults to :subprocess, but can also be :leiningen (for plugins)
189 ;; or :classloader (experimental) to avoid starting a subprocess.
190 :eval-in :leiningen
07a755c8 »
2011-11-04 Add :parent to sample.project.clj
191 ;; Set parent for working with in a multi-module maven project
ef2b0f0b »
2012-01-19 Copy pom.xml generation from depot
192 :parent [org.example/parent "0.0.1" :relative-path "../parent/pom.xml"]
4ef309b4 »
2012-03-05 Update sample.project.clj for 2.0.0-preview.
193 ;; Extensions here will be propagated to the pom.
ef2b0f0b »
2012-01-19 Copy pom.xml generation from depot
194 :extensions [[org.apache.maven.wagon/wagon-webdav "1.0-beta-2"]
195 [foo/bar-baz "1.0"]])
Something went wrong with that request. Please try again.