Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 165 lines (160 sloc) 9.245 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]]]
e30a38d @technomancy Skip fetching deps unnecessarily when :checksum-deps is set.
authored
39 ;; Dev dependencies are intended for use only during
40 ;; development. Projects that depend on this project will not pull
41 ;; in its dev-dependencies, and they won't be included in the uberjar.
42 :dev-dependencies [[org.clojure/swank-clojure "1.2.1"]]
ac9f135 @joegallo Add global :exclusions
joegallo authored
43 ;; Global exclusions are applied across the board, as an alternative
44 ;; to duplication for multiple depedencies with the same excluded libraries.
45 :exclusions [org.apache.poi/poi
46 org.apache.poi/poi-ooxml]
e30a38d @technomancy Skip fetching deps unnecessarily when :checksum-deps is set.
authored
47 ;; Only re-fetch dependencies when they change in project.clj or
48 ;; when :library-path directory is empty.
49 :checksum-deps true
a466709 @technomancy Minor cleanup of :min-lein-version functions.
authored
50 ;; Warns users of earlier versions of Leiningen.
51 :min-lein-version "1.3.0"
3c86ca5 @technomancy Implicitly clean lib/ before running deps. Fixes #61.
authored
52 ;; Before fetching dependencies, the contents of the lib/ directory
53 ;; will get deleted unless this is set to true.
6cc10bc @technomancy s/disable-implicit-clean/disable-deps-clean/. keep backwards-compat.
authored
54 :disable-deps-clean false
c4271c0 @technomancy Switch off :clean-non-project-classes by default. Fixes #141.
authored
55 ;; Delete .class files that do not have a correspoinding package in
56 ;; 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
57 ;; with protocols in upstream libraries; false by default. Set to
58 ;; true to delete all non-project classes or set to a seq of regexes
59 ;; to only delete class files that match one of the regexes.
c4271c0 @technomancy Switch off :clean-non-project-classes by default. Fixes #141.
authored
60 :clean-non-project-classes true
33846ed @technomancy Honor :class-file-whitelist to make classes/ deletion more manageable.
authored
61 ;; If :clean-non-project-classes is set to true, you can set this to
62 ;; be a regex; all class filenames that match this regex will be preserved.
63 :class-file-whitelist #"^(org/example|clojure)"
dcf210d @technomancy Add flexibility to clean task.
authored
64 ;; Additional files (besides :compile-path contents and jars/uberjars)
65 ;; to be deleted during clean phase. May contain %s, which will be replaced
66 ;; with the project's current version number.
67 :extra-files-to-clean ["tmp" "sample-%s.tar"]
68 ;; If the files you want to delete can't be exact matches, you can
69 ;; use a regex that will be matched against filenames in the project root.
70 ;; Defaults to #"^$NAME-.*\.jar$".
71 :regex-to-clean #"hs_err_pid.*"
19b4464 @technomancy Rework some of sample.project.clj.
authored
72 ;; Load these namespaces on startup to pick up hooks from them. Hooks
73 ;; 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
74 :hooks [leiningen.hooks.difftest]
ab0b885 @technomancy Mention :test-selectors in sample.project.clj.
authored
75 ;; Predicates to determine whether to run a test or not. See tutorial.
76 :test-selectors {:default (fn [t] (not (or (:integration v) (:regression v))))
77 :integration :integration
78 :regression :regression}
b5cb0cb @technomancy Don't load hooks unless they're specified in project.clj.
authored
79 ;; Set this to true to search the classpath for hooks. Will load all
80 ;; namespaces matching leiningen.hooks.*. Warning: this will cause
81 ;; Leiningen to start slowly, especially with many dependencies.
82 :implicit-hooks false
915e61a @technomancy Add sample.project.clj showing all honored project keys.
authored
83 ;; These namespaces will be AOT-compiled. Needed for gen-class and
84 ;; other Java interop functionality. :namespaces is an alias for this.
6ca18c8 @technomancy Tighten up regex support in :aot declaration with a list comprehension.
authored
85 ;; Put a regex here to compile all namespaces whose names match.
15ff6b1 @technomancy A few doc changes.
authored
86 :aot [org.example.sample]
c52f044 @technomancy Documentation updates preparing for 1.3.1.
authored
87 ;; The -main function in this namespace will be run at launch if you
88 ;; 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
89 ;; 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
90 ;; run task or shell wrappers without bringing in AOT if you don't need an
91 ;; executable uberjar.
c865d4d @technomancy Fix :main example in sample.project.clj.
authored
92 :main org.example.sample
1943be7 @technomancy Accept :repl-init ns in favour of :repl-init-script.
authored
93 ;; This namespace will get loaded automatically when you launch a repl.
94 :repl-init sample.repl-helper
95 ;; This file will get loaded automatically when you launch a repl,
96 ;; but it's deprecated; use :repl-init above instead.
2247d67 @technomancy Rename :init-script to :repl-init-script; remove global-init-script.
authored
97 :repl-init-script "src/main/clojure/init.clj"
cb51f6e @technomancy Support :repl-options in project.clj.
authored
98 ;; These will get passed to clojure.main/repl; see its docstring for details.
e048036 @technomancy Fix sample.project.clj documentation of :repl-options.
authored
99 :repl-options [:prompt (fn [] (print "your command, master? ") (flush))]
8f50fa7 @technomancy Allow the socket-repl host/port to be customized in project.clj.
authored
100 ;; Customize the socket the repl task listens on.
101 :repl-port 4001
102 :repl-host "0.0.0.0"
c960e5f @technomancy Allow boosting :repl-retry-limit in project.clj for slow-starting projec...
authored
103 ;; If your -main namespace takes a long time to load, it could time out the
104 ;; repl connection. Increase this to give it more time. Defaults to 100.
105 :repl-retry-limit 1000
915e61a @technomancy Add sample.project.clj showing all honored project keys.
authored
106 ;; Emit warnings on all reflection calls.
107 :warn-on-reflection true
108 ;; Set this in order to only use the :repositories you list below.
109 :omit-default-repositories true
13520db @technomancy Add password-protected repository in sample.project.clj.
authored
110 :repositories {"java.net" "http://download.java.net/maven/2"
63e3eb1 @technomancy Update sample.project.clj to mention disabling snapshots/releases.
authored
111 "sonatype"
112 {:url "http://oss.sonatype.org/content/repositories/releases"
fc7ad70 @technomancy Add more :repositories settings details to sample project.clj.
authored
113 ;; If a repository contains releases only; setting :snapshots
114 ;; to false will speed up dependency checking.
115 :snapshots false
116 ;; You can also set the policies for how to handle :checksum
117 ;; failures to :fail, :warn, or :ignore. In :releases, :daily,
118 ;; :always, and :never are supported.
119 :releases {:checksum :fail
120 :update :always}}
121 ;; Repositories named "snapshots" and "releases" automatically
122 ;; have their :snapshots and :releases disabled as appropriate.
781ec86 @technomancy Fix deploy task to use :repositories for configuration.
authored
123 "snapshots" {:url "http://blueant.com/archiva/snapshots"
124 ;; Also supports :private-key and :passphrase.
125 :username "milgrim" :password "locative.1"}
126 "releases" {:url "http://blueant.com/archiva/internal"
127 :username "milgrim" :password "locative.1"}}
915e61a @technomancy Add sample.project.clj showing all honored project keys.
authored
128 ;; If you'd rather use a different directory structure, you can set these.
129 :source-path "src/main/clojure"
130 :library-path "target/dependency"
131 :test-path "src/test/clojure"
b0cd71b @technomancy Add :test-resources-path to sample.project.clj
authored
132 :resources-path "src/main/resource" ; non-code files included in classpath/jar
19b4464 @technomancy Rework some of sample.project.clj.
authored
133 :dev-resources-path "src/test/resource" ; added to dev classpath but not jar
18becb7 @technomancy Add :extra-classpath-dirs to project classpaths.
authored
134 :native-path "src/native" ; where to look for native dependencies
135 :target-dir "target/ " ; where to place the project's jar file
136 :extra-classpath-dirs ["script"] ; more classpath entries not included in jar
137 :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
138 :uberjar-name "sample-standalone.jar" ; as above for uberjar
19b4464 @technomancy Rework some of sample.project.clj.
authored
139 ;; Options to pass to java compiler for java source
140 ;; See http://ant.apache.org/manual/Tasks/javac.html
141 :javac-options {:destdir "classes/"}
142 :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
143 ;; Leave the contents of :source-path out of jars (for AOT projects)
144 :omit-source true
acc9a82 @technomancy Specify what file patterns to exclude from jars. Thanks to Zehua Liu.
authored
145 ;; Files with names matching any of these patterns will be excluded from jars
146 :jar-exclusions [#"(?:^|/).svn/"]
2bda774 @technomancy Add :uberjar-exclusions to project.clj.
authored
147 ;; Same thing, but for uberjars.
148 :uberjar-exclusions [#"META-INF/DUMMY.SF"]
0966229 @technomancy Clean up make-manifest. Fixes #46.
authored
149 ;; Set arbitrary key/value pairs for the jar's manifest.
150 :manifest {"Project-awesome-level" "super-great"}
915e61a @technomancy Add sample.project.clj showing all honored project keys.
authored
151 ;; You can set JVM-level options here.
f732bfe @technomancy Support :eval-in-leiningen key in project.clj for plugins.
authored
152 :jvm-opts ["-Xmx1g"]
153 ;; If your project is a Leiningen plugin, set this to skip the subprocess step
154 :eval-in-leiningen false)
d839074 @technomancy Add prepend-tasks for task hooking in simplistic cases.
authored
155
156 ;; You can use Robert Hooke to modify behaviour of any task function,
157 ;; but the prepend-tasks function is shorthand that is more convenient
158 ;; on tasks that take a single project argument.
159 (use '[leiningen.core :only [prepend-tasks]]
160 '[leiningen.deps :only [deps]]
161 '[leiningen.clean :only [clean]]
162 '[leiningen.pom :only [pom]])
163
164 (prepend-tasks #'deps clean pom)
Something went wrong with that request. Please try again.