Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 181 lines (172 sloc) 10.225 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"]
915e61a @technomancy Add sample.project.clj showing all honored project keys.
authored
35 [log4j "1.2.15" :exclusions [javax.mail/mail
36 javax.jms/jms
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]
a466709 @technomancy Minor cleanup of :min-lein-version functions.
authored
43 ;; Warns users of earlier versions of Leiningen.
44 :min-lein-version "1.3.0"
c4271c0 @technomancy Switch off :clean-non-project-classes by default. Fixes #141.
authored
45 ;; Delete .class files that do not have a correspoinding package in
46 ;; 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
47 ;; with protocols in upstream libraries; false by default. Set to
48 ;; true to delete all non-project classes or set to a seq of regexes
49 ;; to only delete class files that match one of the regexes.
c4271c0 @technomancy Switch off :clean-non-project-classes by default. Fixes #141.
authored
50 :clean-non-project-classes true
33846ed @technomancy Honor :class-file-whitelist to make classes/ deletion more manageable.
authored
51 ;; If :clean-non-project-classes is set to true, you can set this to
52 ;; be a regex; all class filenames that match this regex will be preserved.
53 :class-file-whitelist #"^(org/example|clojure)"
dcf210d @technomancy Add flexibility to clean task.
authored
54 ;; Additional files (besides :compile-path contents and jars/uberjars)
55 ;; to be deleted during clean phase. May contain %s, which will be replaced
56 ;; with the project's current version number.
57 :extra-files-to-clean ["tmp" "sample-%s.tar"]
58 ;; If the files you want to delete can't be exact matches, you can
59 ;; use a regex that will be matched against filenames in the project root.
60 ;; Defaults to #"^$NAME-.*\.jar$".
61 :regex-to-clean #"hs_err_pid.*"
60a8ed8 @technomancy Clarify :checkout-deps-shares in sample.project.clj.
authored
62 ;; Paths to include on the classpath from each project in the
63 ;; checkouts/ directory. (See the FAQ in the Readme for more details
64 ;; about checkout dependencies.) Set this to be a vector of
65 ;; functions that take the target project as argument. Defaults to
66 ;; [:source-path :compile-path :resources-path], but you could use
67 ;; the following to share code from the test suite:
68 :checkout-deps-shares [:source-path :test-path
69 ~(fn [p] (str (:root p) "/lib/dev/*"))]
19b4464 @technomancy Rework some of sample.project.clj.
authored
70 ;; Load these namespaces on startup to pick up hooks from them. Hooks
71 ;; 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
72 :hooks [leiningen.hooks.difftest]
ab0b885 @technomancy Mention :test-selectors in sample.project.clj.
authored
73 ;; Predicates to determine whether to run a test or not. See tutorial.
74 :test-selectors {:default (fn [t] (not (or (:integration v) (:regression v))))
75 :integration :integration
76 :regression :regression}
915e61a @technomancy Add sample.project.clj showing all honored project keys.
authored
77 ;; These namespaces will be AOT-compiled. Needed for gen-class and
78 ;; other Java interop functionality. :namespaces is an alias for this.
6ca18c8 @technomancy Tighten up regex support in :aot declaration with a list comprehension.
authored
79 ;; Put a regex here to compile all namespaces whose names match.
15ff6b1 @technomancy A few doc changes.
authored
80 :aot [org.example.sample]
c52f044 @technomancy Documentation updates preparing for 1.3.1.
authored
81 ;; The -main function in this namespace will be run at launch if you
82 ;; 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
83 ;; 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
84 ;; run task or shell wrappers without bringing in AOT if you don't need an
85 ;; executable uberjar.
c865d4d @technomancy Fix :main example in sample.project.clj.
authored
86 :main org.example.sample
1943be7 @technomancy Accept :repl-init ns in favour of :repl-init-script.
authored
87 ;; This namespace will get loaded automatically when you launch a repl.
88 :repl-init sample.repl-helper
cb51f6e @technomancy Support :repl-options in project.clj.
authored
89 ;; These will get passed to clojure.main/repl; see its docstring for details.
e048036 @technomancy Fix sample.project.clj documentation of :repl-options.
authored
90 :repl-options [:prompt (fn [] (print "your command, master? ") (flush))]
8f50fa7 @technomancy Allow the socket-repl host/port to be customized in project.clj.
authored
91 ;; Customize the socket the repl task listens on.
92 :repl-port 4001
93 :repl-host "0.0.0.0"
ad2e211 @technomancy Support :project-init in project.clj to allow :repl-options to use pprin...
authored
94 ;; A form to prepend to every form that is evaluated inside your project.
95 ;; Allows working around the Gilardi Scenario: http://technomancy.us/143
96 :project-init (require 'clojure.pprint)
c960e5f @technomancy Allow boosting :repl-retry-limit in project.clj for slow-starting projec...
authored
97 ;; If your -main namespace takes a long time to load, it could time out the
98 ;; repl connection. Increase this to give it more time. Defaults to 100.
99 :repl-retry-limit 1000
915e61a @technomancy Add sample.project.clj showing all honored project keys.
authored
100 ;; Emit warnings on all reflection calls.
101 :warn-on-reflection true
2c324b3 @cemerick Upgrade to maven-ant-tasks 2.1.3, explicitly add disabled "central" repo...
cemerick authored
102 ;; Set this in order to only use the :repositories you list below. Note that,
103 ;; if any artifacts are not found, Maven Central will still be reported to
104 ;; have been checked, even though it was not.
915e61a @technomancy Add sample.project.clj showing all honored project keys.
authored
105 :omit-default-repositories true
13520db @technomancy Add password-protected repository in sample.project.clj.
authored
106 :repositories {"java.net" "http://download.java.net/maven/2"
63e3eb1 @technomancy Update sample.project.clj to mention disabling snapshots/releases.
authored
107 "sonatype"
108 {:url "http://oss.sonatype.org/content/repositories/releases"
fc7ad70 @technomancy Add more :repositories settings details to sample project.clj.
authored
109 ;; If a repository contains releases only; setting :snapshots
110 ;; to false will speed up dependency checking.
111 :snapshots false
112 ;; You can also set the policies for how to handle :checksum
113 ;; failures to :fail, :warn, or :ignore. In :releases, :daily,
114 ;; :always, and :never are supported.
115 :releases {:checksum :fail
116 :update :always}}
117 ;; Repositories named "snapshots" and "releases" automatically
118 ;; have their :snapshots and :releases disabled as appropriate.
781ec86 @technomancy Fix deploy task to use :repositories for configuration.
authored
119 "snapshots" {:url "http://blueant.com/archiva/snapshots"
120 ;; Also supports :private-key and :passphrase.
121 :username "milgrim" :password "locative.1"}
122 "releases" {:url "http://blueant.com/archiva/internal"
123 :username "milgrim" :password "locative.1"}}
bd6959c @cemerick Add support for :deploy-repositories slot for deployment-only repositori...
cemerick authored
124 ;; the deploy task will give preference to repositories specified in
125 ;; :deploy-repositories, and repos listed there will not be used for
126 ;; dependency resolution
127 :deploy-repositories {"releases" {:url "http://blueant.com/archiva/internal/releases"
128 :username "milgrim" :password "locative.1"}
129 "snapshots" "http://blueant.com/archiva/internal/snapshots"}
915e61a @technomancy Add sample.project.clj showing all honored project keys.
authored
130 ;; If you'd rather use a different directory structure, you can set these.
ef2b0f0 @xeqi Copy pom.xml generation from depot
xeqi authored
131 :source-path ["src" "src/main/clojure"]
79b8373 @technomancy Add :compile-path to sample.project.clj.
authored
132 :compile-path "target/classes" ; for .class files
133 :library-path "target/dependency" ; for .jar files
ef2b0f0 @xeqi Copy pom.xml generation from depot
xeqi authored
134 :test-path ["test" "src/test/clojure"]
135 :resources-path ["src/main/resource"] ; non-code files included in classpath/jar
136
137 ;;TODO: does dev-resources-path still do anything w/ profiles?
19b4464 @technomancy Rework some of sample.project.clj.
authored
138 :dev-resources-path "src/test/resource" ; added to dev classpath but not jar
ef2b0f0 @xeqi Copy pom.xml generation from depot
xeqi authored
139
18becb7 @technomancy Add :extra-classpath-dirs to project classpaths.
authored
140 :native-path "src/native" ; where to look for native dependencies
141 :target-dir "target/ " ; where to place the project's jar file
142 :extra-classpath-dirs ["script"] ; more classpath entries not included in jar
143 :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
144 :uberjar-name "sample-standalone.jar" ; as above for uberjar
19b4464 @technomancy Rework some of sample.project.clj.
authored
145 ;; Options to pass to java compiler for java source
146 ;; See http://ant.apache.org/manual/Tasks/javac.html
147 :javac-options {:destdir "classes/"}
148 :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
149 ;; Leave the contents of :source-path out of jars (for AOT projects)
150 :omit-source true
acc9a82 @technomancy Specify what file patterns to exclude from jars. Thanks to Zehua Liu.
authored
151 ;; Files with names matching any of these patterns will be excluded from jars
152 :jar-exclusions [#"(?:^|/).svn/"]
2bda774 @technomancy Add :uberjar-exclusions to project.clj.
authored
153 ;; Same thing, but for uberjars.
154 :uberjar-exclusions [#"META-INF/DUMMY.SF"]
0966229 @technomancy Clean up make-manifest. Fixes #46.
authored
155 ;; Set arbitrary key/value pairs for the jar's manifest.
156 :manifest {"Project-awesome-level" "super-great"}
915e61a @technomancy Add sample.project.clj showing all honored project keys.
authored
157 ;; You can set JVM-level options here.
f732bfe @technomancy Support :eval-in-leiningen key in project.clj for plugins.
authored
158 :jvm-opts ["-Xmx1g"]
159 ;; 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
160 :eval-in-leiningen false
07a755c @gmwils Add :parent to sample.project.clj
gmwils authored
161 ;; Set parent for working with in a multi-module maven project
ef2b0f0 @xeqi Copy pom.xml generation from depot
xeqi authored
162 :parent [org.example/parent "0.0.1" :relative-path "../parent/pom.xml"]
163 ;; You can add extensions to the build process (such as add an ftp
164 ;; provider for the Wagon transport mechanism), as well as make
165 ;; plugins active which make changes to the build lifecycle.
166 :extensions [[org.apache.maven.wagon/wagon-webdav "1.0-beta-2"]
167 [foo/bar-baz "1.0"]])
168
169
170 ;;TODO: does the prepend-tasks function still exist?
d839074 @technomancy Add prepend-tasks for task hooking in simplistic cases.
authored
171
172 ;; You can use Robert Hooke to modify behaviour of any task function,
173 ;; but the prepend-tasks function is shorthand that is more convenient
174 ;; on tasks that take a single project argument.
ef2b0f0 @xeqi Copy pom.xml generation from depot
xeqi authored
175 ;; (use '[leiningen.core :only [prepend-tasks]]
176 ;; '[leiningen.deps :only [deps]]
177 ;; '[leiningen.clean :only [clean]]
178 ;; '[leiningen.pom :only [pom]])
d839074 @technomancy Add prepend-tasks for task hooking in simplistic cases.
authored
179
ef2b0f0 @xeqi Copy pom.xml generation from depot
xeqi authored
180 ;; (prepend-tasks #'deps clean pom)
Something went wrong with that request. Please try again.