2012-05-24 04:27:17 +00:00
|
|
|
|
# FAQ
|
|
|
|
|
|
2013-02-21 18:18:54 +00:00
|
|
|
|
**Q:** How do you pronounce Leiningen?
|
2012-05-24 04:27:17 +00:00
|
|
|
|
**A:** It's LINE-ing-en. ['laɪnɪŋən]
|
|
|
|
|
|
2013-02-21 18:18:54 +00:00
|
|
|
|
**Q:** What's a group ID? How do snapshots work?
|
2012-05-24 04:27:17 +00:00
|
|
|
|
**A:** See the
|
2013-02-12 01:19:20 +00:00
|
|
|
|
[tutorial](https://github.com/technomancy/leiningen/blob/stable/doc/TUTORIAL.md)
|
2012-05-24 04:27:17 +00:00
|
|
|
|
for background.
|
|
|
|
|
|
2013-02-21 18:18:54 +00:00
|
|
|
|
**Q:** How should I pick my version numbers?
|
2012-05-24 04:27:17 +00:00
|
|
|
|
**A:** Use [semantic versioning](http://semver.org).
|
|
|
|
|
|
2013-02-21 18:18:54 +00:00
|
|
|
|
**Q:** What if my project depends on jars that aren't in any repository?
|
2013-05-12 21:11:24 +00:00
|
|
|
|
**A:** You will need to get them in a repository. The
|
2013-02-12 01:19:20 +00:00
|
|
|
|
[deploy guide](https://github.com/technomancy/leiningen/blob/stable/doc/DEPLOY.md)
|
2012-12-14 22:45:30 +00:00
|
|
|
|
explains how to set up a private repository. In general it's easiest
|
2013-05-12 21:11:24 +00:00
|
|
|
|
to deploy them to a static HTTP server or a private S3 bucket with the
|
2012-12-14 22:45:30 +00:00
|
|
|
|
[s3-wagon-private](https://github.com/technomancy/s3-wagon-private)
|
2013-05-12 21:11:24 +00:00
|
|
|
|
plugin. Once the repo is set up, `lein deploy private-repo com.mycorp/somejar
|
|
|
|
|
1.0.0 somejar.jar pom.xml` will push the artifacts out. If you don't
|
|
|
|
|
have a pom, you can create a dummy project with `lein new` and
|
|
|
|
|
generate a pom from that. If you are just doing exploratory coding
|
|
|
|
|
you can deploy to `file:///$HOME/.m2/repository` and the jars will
|
|
|
|
|
be available locally.
|
2012-05-24 04:27:17 +00:00
|
|
|
|
|
2013-02-21 18:18:54 +00:00
|
|
|
|
**Q:** I want to hack two projects in parallel, but it's annoying to switch between them.
|
|
|
|
|
**A:** Leiningen provides a feature called *checkout dependencies*.
|
|
|
|
|
See the
|
|
|
|
|
[tutorial](https://github.com/technomancy/leiningen/blob/stable/doc/TUTORIAL.md)
|
2012-10-10 18:16:16 +00:00
|
|
|
|
to learn more.
|
2012-05-24 04:27:17 +00:00
|
|
|
|
|
2013-02-21 18:18:54 +00:00
|
|
|
|
**Q:** Is it possible to exclude indirect dependencies?
|
2012-05-24 04:27:17 +00:00
|
|
|
|
**A:** Yes. Some libraries, such as log4j, depend on projects that are
|
|
|
|
|
not included in public repositories and unnecessary for basic
|
2013-02-12 01:19:20 +00:00
|
|
|
|
functionality. Projects listed as `:dependencies` may exclude
|
2012-05-24 04:27:17 +00:00
|
|
|
|
any of their dependencies by using the `:exclusions` key. See
|
|
|
|
|
`lein help sample` for details.
|
|
|
|
|
|
2013-02-21 18:18:54 +00:00
|
|
|
|
**Q:** Why doesn't `deps` task populate the `lib` directory in version 2?
|
2012-05-24 04:27:17 +00:00
|
|
|
|
**A:** The only reason version 1 copied the jars around in the first
|
|
|
|
|
place was to support existing tooling that needed a cheap way to
|
|
|
|
|
calculate a project's classpath. Now that Leiningen has a mature
|
|
|
|
|
plugin ecosystem, this is no longer needed; jars can be referenced
|
|
|
|
|
directly out of the `~/.m2/repository` directory. If you need to see
|
|
|
|
|
a listing of all the dependencies that will be used and their
|
2012-12-14 22:45:30 +00:00
|
|
|
|
versions, use `lein deps :tree`. To get the classpath use `lein classpath`.
|
2012-05-24 04:27:17 +00:00
|
|
|
|
|
2013-02-21 18:18:54 +00:00
|
|
|
|
**Q:** What does `java.lang.NoSuchMethodError: clojure.lang.RestFn.<init>(I)V` mean?
|
2012-05-24 04:27:17 +00:00
|
|
|
|
**A:** It means you have some code that was AOT (ahead-of-time)
|
|
|
|
|
compiled with a different version of Clojure than the one you're
|
|
|
|
|
currently using. If it persists after running `lein clean` then it
|
|
|
|
|
is a problem with your dependencies. Note that for
|
|
|
|
|
your own project that AOT compilation in Clojure is much less
|
|
|
|
|
important than it is in other languages. There are a few
|
|
|
|
|
language-level features that must be AOT-compiled to work, generally
|
|
|
|
|
for Java interop. If you are not using any of these features, you
|
|
|
|
|
should not AOT-compile your project if other projects may depend
|
|
|
|
|
upon it.
|
|
|
|
|
|
2013-02-21 18:18:54 +00:00
|
|
|
|
**Q:** I specified a dependency on version X but am getting version Y; what's up?
|
2012-05-28 05:00:21 +00:00
|
|
|
|
**A:** One of your dependencies' dependencies has declared a
|
|
|
|
|
dependency on a hard version range, which overrides your "soft"
|
|
|
|
|
declaration. If you change yours to a hard version range, it will
|
|
|
|
|
refuse to function due to conflicts, so it's best to find the
|
2012-12-14 22:45:30 +00:00
|
|
|
|
dependency that's at fault via the
|
|
|
|
|
[lein-pedantic plugin](https://github.com/xeqi/lein-pedantic) and
|
|
|
|
|
add an `:exclusions` clause to it. See `lein help sample` for how
|
2012-05-28 05:00:21 +00:00
|
|
|
|
exclusions work. You may also want to report a bug with the
|
|
|
|
|
dependency that uses hard version ranges as they cause all kinds of
|
|
|
|
|
problems and exhibit unintuitive behaviour.
|
|
|
|
|
|
2013-02-21 18:18:54 +00:00
|
|
|
|
**Q:** I'm behind an HTTP proxy; how can I fetch my dependencies?
|
2012-07-27 09:50:33 +00:00
|
|
|
|
**A:** Set the `$http_proxy` environment variable in Leiningen 2.x. You can also
|
2012-07-27 09:54:30 +00:00
|
|
|
|
set `$http_no_proxy` for a list of hosts that should be reached directly, bypassing
|
2012-07-27 09:55:20 +00:00
|
|
|
|
the proxy. This is a list of patterns separated by `|` and may start or end with
|
2012-07-27 09:54:30 +00:00
|
|
|
|
a `*` for wildcard, e.g. `localhost|*.mydomain.com`.
|
2012-05-24 04:27:17 +00:00
|
|
|
|
For Leiningen 1.x versions, see the instructions for
|
|
|
|
|
[configuring a Maven proxy](http://maven.apache.org/guides/mini/guide-proxies.html)
|
|
|
|
|
using `~/.m2/settings.xml`.
|
|
|
|
|
|
2013-02-21 18:18:54 +00:00
|
|
|
|
**Q:** What can be done to speed up launch?
|
|
|
|
|
**A:** The main delay involved in Leiningen comes from starting two
|
|
|
|
|
JVMs: one for your project and one for Leiningen itself. Most people
|
|
|
|
|
use a development cycle that involves keeping a single project REPL
|
|
|
|
|
process running for as long as they're working on that project.
|
|
|
|
|
Depending on your editor you may be able to do this via its Clojure
|
|
|
|
|
integration. (See [nrepl.el](https://github.com/kingtim/nrepl.el) or
|
|
|
|
|
[foreplay](https://github.com/tpope/vim-foreplay), for example.)
|
|
|
|
|
Otherwise you can use the basic `lein repl`.
|
2012-05-24 04:27:17 +00:00
|
|
|
|
|
2013-02-21 18:18:54 +00:00
|
|
|
|
**Q:** Still too slow; what else can make startup faster?
|
|
|
|
|
**A:** The wiki has a page covering
|
|
|
|
|
[ways to improve startup time](https://github.com/technomancy/leiningen/wiki/Faster).
|
2013-01-19 01:18:31 +00:00
|
|
|
|
|
|
|
|
|
**Q:** It looks like a different set of dependencies are being used in
|
2013-02-21 18:18:54 +00:00
|
|
|
|
the repl vs other tasks.
|
2013-01-19 01:18:31 +00:00
|
|
|
|
**A:** The repl needs to add a few extra implicit dependencies in
|
|
|
|
|
order to function. For instance, it needs to load an
|
|
|
|
|
[nREPL server](https://github.com/clojure/tools.nrepl), and it loads
|
|
|
|
|
a client for fetching
|
|
|
|
|
[ClojureDocs examples](http://clojuredocs.org), both which have
|
|
|
|
|
dependencies that could interfere with the dependencies declared in
|
2013-01-19 23:25:17 +00:00
|
|
|
|
your own project. You can declare a `:leiningen/reply` profile to
|
|
|
|
|
override the clojuredocs client dependencies. While you can't run
|
|
|
|
|
the repl task without nREPL in the dependencies, specifying your own
|
|
|
|
|
version of it will override the version Leiningen adds. Another way
|
|
|
|
|
around the problem would be to load a bare repl by invoking `lein
|
|
|
|
|
trampoline run -m clojure.main/repl`, though you may want to use
|
|
|
|
|
`rlwrap` on that to get proper key bindings and history.
|
2013-03-28 18:00:27 +00:00
|
|
|
|
|
|
|
|
|
**Q:** What does "Unrecognized VM option 'TieredStopAtLevel=1'" mean?
|
|
|
|
|
**A:** Old versions of the JVM do not support the directives Leiningen
|
|
|
|
|
uses for tiered compilation which allow the JVM to boot more
|
|
|
|
|
quickly. You can disable this behaviour with `export LEIN_JVM_OPTS=`
|
|
|
|
|
or upgrade your JVM to something more recent. (newer than b25 of Java 6)
|