2010-06-05 20:26:52 +00:00
|
|
|
;; This is an annotated example of the options that may be set in a
|
|
|
|
;; project.clj file. It is a fairly contrived example in order to
|
|
|
|
;; cover all options exhaustively; it shouldn't be considered a
|
2010-12-25 04:26:19 +00:00
|
|
|
;; representative configuration. For a more detailed explanation of
|
|
|
|
;; some of the terms run "lein help tutorial".
|
2010-06-05 20:26:52 +00:00
|
|
|
|
2012-05-24 04:27:17 +00:00
|
|
|
;; These options apply to Leiningen 2.x. See the 1.x branch for older versions:
|
|
|
|
;; https://github.com/technomancy/leiningen/blob/1.x/sample.project.clj
|
|
|
|
|
2010-06-05 20:26:52 +00:00
|
|
|
;; The project is named "sample", and its group-id is "org.example".
|
|
|
|
(defproject org.example/sample "1.0.0-SNAPSHOT" ; version "1.0.0-SNAPSHOT"
|
2010-06-25 05:08:05 +00:00
|
|
|
;; Beyond this point you may prepend a form with unquote, or ~, to eval it.
|
|
|
|
|
2010-12-25 04:26:19 +00:00
|
|
|
;; The descrption text is searchable from repositories like Clojars.
|
2010-06-05 20:26:52 +00:00
|
|
|
:description "A sample project"
|
|
|
|
:url "http://example.org/sample-clojure-project"
|
2010-06-17 09:33:47 +00:00
|
|
|
;; The mailing list of the project. If the project has multiple mailing
|
|
|
|
;; lists, use the :mailing-lists key (bound to a seq of mailing list
|
|
|
|
;; descriptions as below).
|
|
|
|
:mailing-list {:name "sample mailing list"
|
|
|
|
:archive "http://example.org/sample-mailing-list-archives"
|
2010-07-13 04:16:02 +00:00
|
|
|
:other-archives ["http://example.org/sample-list-archive2"
|
|
|
|
"http://example.org/sample-list-archive3"]
|
2010-06-17 09:33:47 +00:00
|
|
|
:post "list@example.org"
|
|
|
|
:subscribe "list-subscribe@example.org"
|
|
|
|
:unsubscribe "list-unsubscribe@example.org"}
|
|
|
|
;; The project's license. :distribution should be :repo or :manual;
|
|
|
|
;; :repo means it is ok for public repositories to host this project's
|
2010-12-25 04:26:19 +00:00
|
|
|
;; artifacts. A seq of :licenses is also supported.
|
2010-06-17 09:33:47 +00:00
|
|
|
:license {:name "Eclipse Public License - v 1.0"
|
|
|
|
:url "http://www.eclipse.org/legal/epl-v10.html"
|
|
|
|
:distribution :repo
|
|
|
|
:comments "same as Clojure"}
|
2010-06-05 20:26:52 +00:00
|
|
|
;; Dependencies are listed as [group-id/name version].
|
2012-03-06 01:44:26 +00:00
|
|
|
:dependencies [[org.clojure/clojure "1.3.0"]
|
2012-04-10 04:13:04 +00:00
|
|
|
[org.jclouds/jclouds "1.0" :classifier "jdk15" :scope "test"]
|
2012-03-30 04:26:30 +00:00
|
|
|
[net.sf.ehcache/ehcache "2.3.1" :extension "pom"]
|
2012-04-10 04:13:04 +00:00
|
|
|
[log4j "1.2.15" :exclusions [[javax.mail/mail :extension "jar"]
|
|
|
|
[javax.jms/jms :classifier "*"]
|
2010-06-05 20:26:52 +00:00
|
|
|
com.sun.jdmk/jmxtools
|
|
|
|
com.sun.jmx/jmxri]]]
|
2011-03-11 17:25:28 +00:00
|
|
|
;; Global exclusions are applied across the board, as an alternative
|
|
|
|
;; to duplication for multiple depedencies with the same excluded libraries.
|
|
|
|
:exclusions [org.apache.poi/poi
|
|
|
|
org.apache.poi/poi-ooxml]
|
2012-04-11 00:27:49 +00:00
|
|
|
;; Plugins are code that runs in Leiningen itself and usually
|
|
|
|
;; provides new tasks or hooks.
|
2012-03-06 01:44:26 +00:00
|
|
|
:plugins [[lein-pprint "1.1.1"]
|
2012-05-03 23:33:12 +00:00
|
|
|
[lein-assoc "0.1.0"]
|
|
|
|
[s3-wagon-private "1.1.1"]]
|
2012-06-02 00:01:24 +00:00
|
|
|
;; If you configure a custom repository with a self-signed SSL
|
|
|
|
;; certificate, you will need to add it here. Paths should be either
|
|
|
|
;; be on Leiningen's classpath or relative to the project root.
|
|
|
|
:certificates ["blueant.pem"]
|
2012-03-06 01:44:26 +00:00
|
|
|
;; Each active profile gets merged into the project map. The :dev
|
|
|
|
;; and :user profiles are active by default, but the latter should be
|
|
|
|
;; looked up in ~/.lein/profiles.clj rather than set in project.clj.
|
|
|
|
;; Use the with-profiles higher-order task to run a task with a
|
|
|
|
;; different set of active profiles.
|
2012-05-25 01:26:46 +00:00
|
|
|
;; See `lein help profiles` for a detailed explanation.
|
2012-03-06 01:44:26 +00:00
|
|
|
:profiles {:dev {:resource-paths ["dummy-data"]
|
|
|
|
:dependencies [[clj-stacktrace "0.2.4"]]}
|
|
|
|
:debug {:debug true
|
2012-03-28 20:37:06 +00:00
|
|
|
:injections [(prn (into {} (System/getProperties)))]}
|
2012-03-06 01:44:26 +00:00
|
|
|
:1.4 {:dependencies [[org.clojure/clojure "1.4.0-alpha1"]]}}
|
2012-04-10 04:13:04 +00:00
|
|
|
;; Support project-specific task aliases. These are interpreted in
|
|
|
|
;; the same way as command-line arguments to the lein command. If
|
|
|
|
;; the alias points to a vector, it uses partial application. For
|
|
|
|
;; example, "lein with-magic run -m hi.core" would be equivalent to
|
|
|
|
;; "lein assoc :magic true run -m hi.core".
|
2012-03-06 01:44:26 +00:00
|
|
|
:aliases {"launch" "run"
|
|
|
|
"with-magic" ["assoc" ":magic" "true"]}
|
2012-04-10 04:13:04 +00:00
|
|
|
;; Normally Leiningen runs the javac and compile tasks before
|
|
|
|
;; calling any eval-in-project code, but you can override this with
|
|
|
|
;; the :prep-tasks key to do other things like compile protocol buffers.
|
|
|
|
:prep-tasks ["protoc" "compile"]
|
2010-08-24 04:21:54 +00:00
|
|
|
;; Warns users of earlier versions of Leiningen.
|
2012-03-06 01:44:26 +00:00
|
|
|
:min-lein-version "2.0.0"
|
2011-07-06 03:29:35 +00:00
|
|
|
;; Paths to include on the classpath from each project in the
|
|
|
|
;; checkouts/ directory. (See the FAQ in the Readme for more details
|
|
|
|
;; about checkout dependencies.) Set this to be a vector of
|
|
|
|
;; functions that take the target project as argument. Defaults to
|
2012-04-11 00:27:49 +00:00
|
|
|
;; [:source-paths :compile-path :resource-paths], but you could use
|
2011-07-06 03:29:35 +00:00
|
|
|
;; the following to share code from the test suite:
|
2012-04-11 00:27:49 +00:00
|
|
|
:checkout-deps-shares [:source-paths :test-paths
|
2011-07-06 03:29:35 +00:00
|
|
|
~(fn [p] (str (:root p) "/lib/dev/*"))]
|
2012-03-06 01:44:26 +00:00
|
|
|
;; Load these namespaces on startup to pick up hooks from them.
|
2010-07-30 20:28:18 +00:00
|
|
|
:hooks [leiningen.hooks.difftest]
|
2010-11-25 05:18:47 +00:00
|
|
|
;; Predicates to determine whether to run a test or not. See tutorial.
|
|
|
|
:test-selectors {:default (fn [t] (not (or (:integration v) (:regression v))))
|
|
|
|
:integration :integration
|
|
|
|
:regression :regression}
|
2010-06-05 20:26:52 +00:00
|
|
|
;; These namespaces will be AOT-compiled. Needed for gen-class and
|
2012-04-11 00:27:49 +00:00
|
|
|
;; other Java interop functionality. Put a regex here to compile all
|
|
|
|
;; namespaces whose names match.
|
2011-01-25 03:42:38 +00:00
|
|
|
:aot [org.example.sample]
|
2010-09-05 22:19:18 +00:00
|
|
|
;; The -main function in this namespace will be run at launch if you
|
2012-04-11 00:27:49 +00:00
|
|
|
;; create an uberjar. Set :skip-aot metadata on this symbol to use
|
|
|
|
;; it for other things like the run task or shell wrappers without
|
|
|
|
;; bringing in AOT if you don't need an executable uberjar.
|
2010-08-23 04:14:58 +00:00
|
|
|
:main org.example.sample
|
2012-04-10 23:09:20 +00:00
|
|
|
;; Options to change the way the REPL behaves
|
2012-04-11 14:43:49 +00:00
|
|
|
:repl-options {;; Specify the string to print when prompting for input.
|
|
|
|
;; defaults to something like (fn [ns] (str *ns* "=> "))
|
|
|
|
:prompt (fn [ns] (str "your command for <" ns ">, master? " ))
|
|
|
|
;; Specify the ns to start the REPL in (overrides :main in
|
|
|
|
;; this case only)
|
|
|
|
:init-ns foo.bar
|
|
|
|
;; This expression will run when first opening a REPL, in the
|
|
|
|
;; namespace from :init-ns or :main if specified
|
|
|
|
:init (println "here we are in" *ns*)
|
2012-04-10 23:09:20 +00:00
|
|
|
;; Customize the socket the repl task listens on and
|
|
|
|
;; attaches to.
|
|
|
|
:host "0.0.0.0"
|
|
|
|
:port 4001
|
|
|
|
;; If nREPL takes too long to load it may timeout,
|
|
|
|
;; increase this to wait longer before timing out.
|
|
|
|
;; Defaults to 30000 (30 seconds)
|
|
|
|
:timeout 40000}
|
2012-03-28 20:37:06 +00:00
|
|
|
;; Forms to prepend to every form that is evaluated inside your project.
|
2012-03-06 01:44:26 +00:00
|
|
|
;; Allows working around the Gilardi Scenario: http://technomancy.us/143
|
2012-03-28 20:37:06 +00:00
|
|
|
:injections [(require 'clojure.pprint)]
|
2010-06-05 20:26:52 +00:00
|
|
|
;; Emit warnings on all reflection calls.
|
|
|
|
:warn-on-reflection true
|
2012-03-06 01:44:26 +00:00
|
|
|
;; Set this in order to only use the :repositories you list below.
|
2010-06-05 20:26:52 +00:00
|
|
|
:omit-default-repositories true
|
2012-03-06 01:44:26 +00:00
|
|
|
;; These repositories will be searched for :dependencies and
|
|
|
|
;; :plugins and will also be available to deploy to.
|
|
|
|
:repositories {"java.net" "http://download.java.net/maven/2"
|
|
|
|
"sonatype"
|
|
|
|
{:url "http://oss.sonatype.org/content/repositories/releases"
|
|
|
|
;; If a repository contains releases only; setting :snapshots
|
|
|
|
;; to false will speed up dependency checking.
|
|
|
|
:snapshots false
|
|
|
|
;; You can also set the policies for how to handle :checksum
|
|
|
|
;; failures to :fail, :warn, or :ignore. In :releases, :daily,
|
|
|
|
;; :always, and :never are supported.
|
2012-05-11 18:29:57 +00:00
|
|
|
:releases {:checksum :fail :update :always}
|
|
|
|
;; You can set :checksum and :update here for them
|
|
|
|
;; to apply to both :releases and :snapshots:
|
|
|
|
:update :always, :checksum :fail}
|
2011-04-12 03:21:32 +00:00
|
|
|
;; Repositories named "snapshots" and "releases" automatically
|
|
|
|
;; have their :snapshots and :releases disabled as appropriate.
|
2012-03-06 01:44:26 +00:00
|
|
|
;; Credentials for repositories should *not* be stored
|
|
|
|
;; in project.clj but in ~/.lein/profiles.clj instead:
|
|
|
|
;; {:auth {:repository-auth {#"http://blueant.com/archiva/"
|
|
|
|
;; {:username "milgrim"
|
|
|
|
;; :password "locative.1"}}}}
|
|
|
|
"snapshots" "http://blueant.com/archiva/snapshots"
|
2012-06-02 00:26:16 +00:00
|
|
|
"releases" {:url "http://blueant.com/archiva/internal"
|
|
|
|
;; Using :env as a value here will cause an
|
|
|
|
;; enironment variable to be used based on
|
|
|
|
;; the key; in this case LEIN_PASSWORD.
|
|
|
|
:username "milgrim" :password :env}}
|
2012-05-11 18:29:57 +00:00
|
|
|
;; You can set :update and :checksum policies here to have them
|
2012-05-11 18:43:37 +00:00
|
|
|
;; apply for all :repositories. Usually you will not set :update
|
2012-05-11 18:29:57 +00:00
|
|
|
;; directly but apply the "update" profile instead.
|
|
|
|
:update :always
|
2011-09-16 01:29:18 +00:00
|
|
|
;; the deploy task will give preference to repositories specified in
|
|
|
|
;; :deploy-repositories, and repos listed there will not be used for
|
2012-03-06 01:44:26 +00:00
|
|
|
;; dependency resolution.
|
|
|
|
:deploy-repositories {"releases" "http://blueant.com/archiva/internal/releases"
|
|
|
|
"snapshots" "http://blueant.com/archiva/internal/snapshots"}
|
2012-06-25 18:08:59 +00:00
|
|
|
;; Fetch dependencies from mirrors. Mirrors override repositories when the key
|
|
|
|
;; in the :mirrors map matches either the name or URL of a specified
|
|
|
|
;; repository. All settings supported in :repositories may be set here too.
|
|
|
|
:mirrors {"central" {:name "Ibiblio"
|
|
|
|
:url "http://mirrors.ibiblio.org/pub/mirrors/maven2"}
|
|
|
|
#"clojars" {:name "Internal nexus"
|
|
|
|
:url "http://mvn.local/nexus/releases"
|
|
|
|
:repo-manager true}}
|
2012-03-07 02:06:21 +00:00
|
|
|
;; Prevent Leiningen from checking the network for dependencies.
|
|
|
|
;; This wouldn't normally be set in project.clj; it would come from a profile.
|
|
|
|
:offline? true
|
|
|
|
;; Override the location of the local maven repository.
|
|
|
|
:local-repo "/home/dude/.lein/repo"
|
2010-06-05 20:26:52 +00:00
|
|
|
;; If you'd rather use a different directory structure, you can set these.
|
2012-03-06 01:44:26 +00:00
|
|
|
;; Paths that contain "inputs" are vectors, "outputs" are strings.
|
|
|
|
:source-paths ["src" "src/main/clojure"]
|
2012-04-11 00:27:49 +00:00
|
|
|
:java-source-paths ["src/main/java"] ; Java source is stored separately.
|
2012-03-06 01:44:26 +00:00
|
|
|
:test-paths ["test" "src/test/clojure"]
|
|
|
|
:resource-paths ["src/main/resource"] ; non-code files included in classpath/jar
|
2012-04-11 00:27:49 +00:00
|
|
|
:compile-path "target/classes" ; for .class files
|
2012-03-31 23:09:42 +00:00
|
|
|
:native-path "src/native" ; where to extract native dependencies
|
2012-03-24 20:50:12 +00:00
|
|
|
:target-path "target/" ; where to place the project's jar file
|
2011-04-22 23:18:49 +00:00
|
|
|
:jar-name "sample.jar" ; name of the jar produced by 'lein jar'
|
2010-06-24 01:03:20 +00:00
|
|
|
:uberjar-name "sample-standalone.jar" ; as above for uberjar
|
2010-12-25 04:26:19 +00:00
|
|
|
;; Options to pass to java compiler for java source
|
2012-06-22 12:39:41 +00:00
|
|
|
:javac-options {:destdir "classes/"}
|
2012-04-11 00:27:49 +00:00
|
|
|
;; Leave the contents of :source-paths out of jars (for AOT projects)
|
2010-08-16 20:22:56 +00:00
|
|
|
:omit-source true
|
2010-09-24 05:45:57 +00:00
|
|
|
;; Files with names matching any of these patterns will be excluded from jars
|
|
|
|
:jar-exclusions [#"(?:^|/).svn/"]
|
2010-11-20 19:03:00 +00:00
|
|
|
;; Same thing, but for uberjars.
|
|
|
|
:uberjar-exclusions [#"META-INF/DUMMY.SF"]
|
2012-04-03 20:03:51 +00:00
|
|
|
;; Add arbitrary jar entries. Supports :path, :paths, :bytes, and :fn types.
|
|
|
|
:filespecs [{:type :path :path "config/base.clj"}
|
|
|
|
;; directory paths are included recursively
|
|
|
|
{:type :paths :paths ["config/web" "config/cli"]}
|
|
|
|
;; programmatically-generated content can use :bytes
|
|
|
|
{:type :bytes :path "project.clj"
|
|
|
|
;; strings or byte arrays are accepted
|
|
|
|
:bytes ~(slurp "project.clj")}
|
|
|
|
;; :fn filespecs take the project as an argument and
|
|
|
|
;; should return a filespec map of one of the other types.
|
|
|
|
{:type :fn :fn (fn [p]
|
|
|
|
{:type :bytes :path "git-log"
|
|
|
|
:bytes (:out (clojure.java.shell/sh
|
|
|
|
"git" "log" "-n" "1"))})}]
|
2010-08-08 23:16:48 +00:00
|
|
|
;; Set arbitrary key/value pairs for the jar's manifest.
|
2012-04-30 18:11:21 +00:00
|
|
|
:manifest {"Project-awesome-level" "super-great"
|
|
|
|
;; function values will be called with the project as an argument.
|
|
|
|
"Class-Path" ~#(clojure.string/join
|
2012-04-30 20:18:19 +00:00
|
|
|
\space
|
2012-04-30 18:11:21 +00:00
|
|
|
(leiningen.core.classpath/get-classpath %))
|
|
|
|
;; symbol values will be resolved to find a function to call.
|
|
|
|
"Grunge-level" my.plugin/calculate-grunginess}
|
2010-06-05 20:26:52 +00:00
|
|
|
;; You can set JVM-level options here.
|
2010-10-24 21:28:26 +00:00
|
|
|
:jvm-opts ["-Xmx1g"]
|
2012-04-11 00:27:49 +00:00
|
|
|
;; Control the context in which your project code is evaluated.
|
|
|
|
;; Defaults to :subprocess, but can also be :leiningen (for plugins)
|
|
|
|
;; or :classloader (experimental) to avoid starting a subprocess.
|
|
|
|
:eval-in :leiningen
|
2012-06-15 17:48:19 +00:00
|
|
|
;; Enable bootclasspath optimization. This improves boot time but interferes
|
2012-06-14 23:26:22 +00:00
|
|
|
;; with using things like pomegranate at runtime and using Clojure 1.2.
|
2012-06-15 17:48:19 +00:00
|
|
|
:bootclasspath true
|
2011-11-04 10:45:31 +00:00
|
|
|
;; Set parent for working with in a multi-module maven project
|
2012-01-20 03:57:15 +00:00
|
|
|
:parent [org.example/parent "0.0.1" :relative-path "../parent/pom.xml"]
|
2012-05-03 23:33:12 +00:00
|
|
|
;; Extensions here will be propagated to the pom but not used by Leiningen.
|
2012-01-20 03:57:15 +00:00
|
|
|
:extensions [[org.apache.maven.wagon/wagon-webdav "1.0-beta-2"]
|
2012-06-20 21:50:25 +00:00
|
|
|
[foo/bar-baz "1.0"]]
|
2012-06-20 22:12:01 +00:00
|
|
|
;; If :scm is set, all key/value pairs appear exactly as configured, otherwise
|
|
|
|
;; Leiningen will try to use information from a .git directory if it is present.
|
|
|
|
;; The only purpose is the generation of the <scm> tag in pom.xml.
|
2012-06-20 21:50:25 +00:00
|
|
|
:scm {:name "git" :tag "098afd745bcd" :url "http://127.0.0.1/git/my-project"})
|