Skip to content

HTTPS clone URL

Subversion checkout URL

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