Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 208 lines (203 sloc) 11.992 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].
32 :dependencies [[org.clojure/clojure "1.1.0"]
33 [org.clojure/clojure-contrib "1.1.0"]
fa2b1cc @technomancy Fix sample.project.clj typo.
authored
34 [org.jclouds/jclouds "1.0-RC6" :classifier "jdk15"]
9254c04 @technomancy Document :type in :dependencies in sample.project.clj.
authored
35 [net.sf.ehcache/ehcache "2.3.1" :type "pom"]
915e61a @technomancy Add sample.project.clj showing all honored project keys.
authored
36 [log4j "1.2.15" :exclusions [javax.mail/mail
37 javax.jms/jms
38 com.sun.jdmk/jmxtools
39 com.sun.jmx/jmxri]]]
d3dca71 @technomancy Download plugins. RT/addURL is a nest of filthy lies.
authored
40 ;; The plugins listed here will be accessible in Leiningen's own
41 ;; process, but not in the project.
42 :plugins [[lein-tar "1.0.6"]]
e30a38d @technomancy Skip fetching deps unnecessarily when :checksum-deps is set.
authored
43 ;; Dev dependencies are intended for use only during
44 ;; development. Projects that depend on this project will not pull
45 ;; in its dev-dependencies, and they won't be included in the uberjar.
d3dca71 @technomancy Download plugins. RT/addURL is a nest of filthy lies.
authored
46 ;; These will appear both in Leiningen's process and the project's.
e30a38d @technomancy Skip fetching deps unnecessarily when :checksum-deps is set.
authored
47 :dev-dependencies [[org.clojure/swank-clojure "1.2.1"]]
ac9f135 @joegallo Add global :exclusions
joegallo authored
48 ;; Global exclusions are applied across the board, as an alternative
49 ;; to duplication for multiple depedencies with the same excluded libraries.
50 :exclusions [org.apache.poi/poi
51 org.apache.poi/poi-ooxml]
e30a38d @technomancy Skip fetching deps unnecessarily when :checksum-deps is set.
authored
52 ;; Only re-fetch dependencies when they change in project.clj or
53 ;; when :library-path directory is empty.
54 :checksum-deps true
a466709 @technomancy Minor cleanup of :min-lein-version functions.
authored
55 ;; Warns users of earlier versions of Leiningen.
56 :min-lein-version "1.3.0"
3c86ca5 @technomancy Implicitly clean lib/ before running deps. Fixes #61.
authored
57 ;; Before fetching dependencies, the contents of the lib/ directory
58 ;; will get deleted unless this is set to true.
6cc10bc @technomancy s/disable-implicit-clean/disable-deps-clean/. keep backwards-compat.
authored
59 :disable-deps-clean false
c4271c0 @technomancy Switch off :clean-non-project-classes by default. Fixes #141.
authored
60 ;; Delete .class files that do not have a correspoinding package in
61 ;; the src/ directory. Workaround for Clojure bug CLJ-322. Causes problems
b4943e1 @technomancy Allow :clean-non-project-classes to be a seq of regexes.
authored
62 ;; with protocols in upstream libraries; false by default. Set to
63 ;; true to delete all non-project classes or set to a seq of regexes
64 ;; to only delete class files that match one of the regexes.
c4271c0 @technomancy Switch off :clean-non-project-classes by default. Fixes #141.
authored
65 :clean-non-project-classes true
33846ed @technomancy Honor :class-file-whitelist to make classes/ deletion more manageable.
authored
66 ;; If :clean-non-project-classes is set to true, you can set this to
67 ;; be a regex; all class filenames that match this regex will be preserved.
68 :class-file-whitelist #"^(org/example|clojure)"
dcf210d @technomancy Add flexibility to clean task.
authored
69 ;; Additional files (besides :compile-path contents and jars/uberjars)
70 ;; to be deleted during clean phase. May contain %s, which will be replaced
71 ;; with the project's current version number.
72 :extra-files-to-clean ["tmp" "sample-%s.tar"]
73 ;; If the files you want to delete can't be exact matches, you can
74 ;; use a regex that will be matched against filenames in the project root.
75 ;; Defaults to #"^$NAME-.*\.jar$".
76 :regex-to-clean #"hs_err_pid.*"
60a8ed8 @technomancy Clarify :checkout-deps-shares in sample.project.clj.
authored
77 ;; Paths to include on the classpath from each project in the
78 ;; checkouts/ directory. (See the FAQ in the Readme for more details
79 ;; about checkout dependencies.) Set this to be a vector of
80 ;; functions that take the target project as argument. Defaults to
81 ;; [:source-path :compile-path :resources-path], but you could use
82 ;; the following to share code from the test suite:
83 :checkout-deps-shares [:source-path :test-path
84 ~(fn [p] (str (:root p) "/lib/dev/*"))]
19b4464 @technomancy Rework some of sample.project.clj.
authored
85 ;; Load these namespaces on startup to pick up hooks from them. Hooks
86 ;; generally come from plugins, but may be included in your project source.
b5cb0cb @technomancy Don't load hooks unless they're specified in project.clj.
authored
87 :hooks [leiningen.hooks.difftest]
ab0b885 @technomancy Mention :test-selectors in sample.project.clj.
authored
88 ;; Predicates to determine whether to run a test or not. See tutorial.
89 :test-selectors {:default (fn [t] (not (or (:integration v) (:regression v))))
90 :integration :integration
91 :regression :regression}
b5cb0cb @technomancy Don't load hooks unless they're specified in project.clj.
authored
92 ;; Set this to true to search the classpath for hooks. Will load all
93 ;; namespaces matching leiningen.hooks.*. Warning: this will cause
94 ;; Leiningen to start slowly, especially with many dependencies.
95 :implicit-hooks false
915e61a @technomancy Add sample.project.clj showing all honored project keys.
authored
96 ;; These namespaces will be AOT-compiled. Needed for gen-class and
97 ;; other Java interop functionality. :namespaces is an alias for this.
6ca18c8 @technomancy Tighten up regex support in :aot declaration with a list comprehension.
authored
98 ;; Put a regex here to compile all namespaces whose names match.
15ff6b1 @technomancy A few doc changes.
authored
99 :aot [org.example.sample]
c52f044 @technomancy Documentation updates preparing for 1.3.1.
authored
100 ;; The -main function in this namespace will be run at launch if you
101 ;; 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
102 ;; 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
103 ;; run task or shell wrappers without bringing in AOT if you don't need an
104 ;; executable uberjar.
c865d4d @technomancy Fix :main example in sample.project.clj.
authored
105 :main org.example.sample
1943be7 @technomancy Accept :repl-init ns in favour of :repl-init-script.
authored
106 ;; This namespace will get loaded automatically when you launch a repl.
107 :repl-init sample.repl-helper
108 ;; This file will get loaded automatically when you launch a repl,
109 ;; but it's deprecated; use :repl-init above instead.
2247d67 @technomancy Rename :init-script to :repl-init-script; remove global-init-script.
authored
110 :repl-init-script "src/main/clojure/init.clj"
cb51f6e @technomancy Support :repl-options in project.clj.
authored
111 ;; These will get passed to clojure.main/repl; see its docstring for details.
e048036 @technomancy Fix sample.project.clj documentation of :repl-options.
authored
112 :repl-options [:prompt (fn [] (print "your command, master? ") (flush))]
8f50fa7 @technomancy Allow the socket-repl host/port to be customized in project.clj.
authored
113 ;; Customize the socket the repl task listens on.
114 :repl-port 4001
115 :repl-host "0.0.0.0"
ad2e211 @technomancy Support :project-init in project.clj to allow :repl-options to use pp…
authored
116 ;; A form to prepend to every form that is evaluated inside your project.
117 ;; Allows working around the Gilardi Scenario: http://technomancy.us/143
118 :project-init (require 'clojure.pprint)
c960e5f @technomancy Allow boosting :repl-retry-limit in project.clj for slow-starting pro…
authored
119 ;; If your -main namespace takes a long time to load, it could time out the
120 ;; repl connection. Increase this to give it more time. Defaults to 100.
121 :repl-retry-limit 1000
915e61a @technomancy Add sample.project.clj showing all honored project keys.
authored
122 ;; Emit warnings on all reflection calls.
123 :warn-on-reflection true
2c324b3 @cemerick Upgrade to maven-ant-tasks 2.1.3, explicitly add disabled "central" r…
cemerick authored
124 ;; Set this in order to only use the :repositories you list below. Note that,
125 ;; if any artifacts are not found, Maven Central will still be reported to
126 ;; have been checked, even though it was not.
915e61a @technomancy Add sample.project.clj showing all honored project keys.
authored
127 :omit-default-repositories true
13520db @technomancy Add password-protected repository in sample.project.clj.
authored
128 :repositories {"java.net" "http://download.java.net/maven/2"
63e3eb1 @technomancy Update sample.project.clj to mention disabling snapshots/releases.
authored
129 "sonatype"
130 {:url "http://oss.sonatype.org/content/repositories/releases"
fc7ad70 @technomancy Add more :repositories settings details to sample project.clj.
authored
131 ;; If a repository contains releases only; setting :snapshots
132 ;; to false will speed up dependency checking.
133 :snapshots false
134 ;; You can also set the policies for how to handle :checksum
135 ;; failures to :fail, :warn, or :ignore. In :releases, :daily,
136 ;; :always, and :never are supported.
137 :releases {:checksum :fail
138 :update :always}}
139 ;; Repositories named "snapshots" and "releases" automatically
140 ;; have their :snapshots and :releases disabled as appropriate.
781ec86 @technomancy Fix deploy task to use :repositories for configuration.
authored
141 "snapshots" {:url "http://blueant.com/archiva/snapshots"
51adb83 @technomancy Emphasize that it's best to keep repository credentials out of projec…
authored
142 ;; You should store credentials in your ~/.lein/init.clj
143 ;; file; see "lein help deploy" for details.
781ec86 @technomancy Fix deploy task to use :repositories for configuration.
authored
144 ;; Also supports :private-key and :passphrase.
145 :username "milgrim" :password "locative.1"}
146 "releases" {:url "http://blueant.com/archiva/internal"
147 :username "milgrim" :password "locative.1"}}
bd6959c @cemerick Add support for :deploy-repositories slot for deployment-only reposit…
cemerick authored
148 ;; the deploy task will give preference to repositories specified in
149 ;; :deploy-repositories, and repos listed there will not be used for
150 ;; dependency resolution
151 :deploy-repositories {"releases" {:url "http://blueant.com/archiva/internal/releases"
152 :username "milgrim" :password "locative.1"}
153 "snapshots" "http://blueant.com/archiva/internal/snapshots"}
915e61a @technomancy Add sample.project.clj showing all honored project keys.
authored
154 ;; If you'd rather use a different directory structure, you can set these.
155 :source-path "src/main/clojure"
79b8373 @technomancy Add :compile-path to sample.project.clj.
authored
156 :compile-path "target/classes" ; for .class files
157 :library-path "target/dependency" ; for .jar files
915e61a @technomancy Add sample.project.clj showing all honored project keys.
authored
158 :test-path "src/test/clojure"
b0cd71b @technomancy Add :test-resources-path to sample.project.clj
authored
159 :resources-path "src/main/resource" ; non-code files included in classpath/jar
19b4464 @technomancy Rework some of sample.project.clj.
authored
160 :dev-resources-path "src/test/resource" ; added to dev classpath but not jar
18becb7 @technomancy Add :extra-classpath-dirs to project classpaths.
authored
161 :native-path "src/native" ; where to look for native dependencies
162 :target-dir "target/ " ; where to place the project's jar file
163 :extra-classpath-dirs ["script"] ; more classpath entries not included in jar
164 :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
165 :uberjar-name "sample-standalone.jar" ; as above for uberjar
eaf0de1 @technomancy Support :local-repo-classpath.
authored
166 ;; Construct classpath from jars in ~/.m2 rather than copying to :library-path
167 :local-repo-classpath true
19b4464 @technomancy Rework some of sample.project.clj.
authored
168 ;; Options to pass to java compiler for java source
169 ;; See http://ant.apache.org/manual/Tasks/javac.html
170 :javac-options {:destdir "classes/"}
171 :java-source-path "src/main/java" ; location of Java source
0e189a8 @technomancy Add :omit-source option to leave files in :source-path out of jars.
authored
172 ;; Leave the contents of :source-path out of jars (for AOT projects)
173 :omit-source true
acc9a82 @technomancy Specify what file patterns to exclude from jars. Thanks to Zehua Liu.
authored
174 ;; Files with names matching any of these patterns will be excluded from jars
175 :jar-exclusions [#"(?:^|/).svn/"]
2bda774 @technomancy Add :uberjar-exclusions to project.clj.
authored
176 ;; Same thing, but for uberjars.
177 :uberjar-exclusions [#"META-INF/DUMMY.SF"]
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
184 ;; Leiningen includes a workaround for a problem with Clojure's
185 ;; agent thread pool. If you see RejectedExecutionException using
186 ;; futures or agents, you may be working with a plugin that doesn't
187 ;; take this workaround into account yet--see the "Threads" section
188 ;; of doc/PLUGINS.md. This key will disable Leiningen's workaround.
189 ;; It may cause some other plugins to fail to exit when they finish.
07a755c @gmwils Add :parent to sample.project.clj
gmwils authored
190 :skip-shutdown-agents true
191 ;; Set parent for working with in a multi-module maven project
efe703f @mpenet update sample project file with extension example
mpenet authored
192 :parent [org.example/parent "0.0.1" :relative-path "../parent/pom.xml"]
193 ;; You can add extensions to the build process (such as add an ftp
194 ;; provider for the Wagon transport mechanism), as well as make
195 ;; plugins active which make changes to the build lifecycle.
196 :extensions [[org.apache.maven.wagon/wagon-webdav "1.0-beta-2"]
197 [foo/bar-baz "1.0"]])
d839074 @technomancy Add prepend-tasks for task hooking in simplistic cases.
authored
198
199 ;; You can use Robert Hooke to modify behaviour of any task function,
200 ;; but the prepend-tasks function is shorthand that is more convenient
201 ;; on tasks that take a single project argument.
202 (use '[leiningen.core :only [prepend-tasks]]
203 '[leiningen.deps :only [deps]]
204 '[leiningen.clean :only [clean]]
205 '[leiningen.pom :only [pom]])
206
207 (prepend-tasks #'deps clean pom)
Something went wrong with that request. Please try again.