14. Leiningen
… more fun than Maven
… easy way to kick-start your Clojure
addiction
15. Leiningen: Manual install
Download the Leiningen 2 install script from
leiningen.org
Move the lein file to an executable location, eg.
~/bin
Make the install script executable and run the install
chmod u+x ~/bin/lein
lein
17. Leiningen
also staring in
Eclipse plugin
Counter Clockwise
18. All the usual tasks...
lein new ● Create a new clojure project
lein deps ● Download all dependencies
lein run ● Run your application
lein jar ● Deploy your app as a jar
19. ...and then some
lein uberjar - Include Clojure & all your
dependencies in one jar
lein repl - Fire up the dynamic coding
environment (REPL)
- Hook to start a REPL from
jack-in within Emacs
20. Fire up the REPL
REPL: read, evaluate, print loop – dynamic
lein repl environment for Clojure and other lisps
21. Typing code into the REPL
Develop functions and data structures on the fly
REPL: read, evaluate, print loop – dynamic environment for Clojure and other lisps
22. Create a new project
lein new my-project
cd my-project
lein deps
Lein deps will check your project.clj configuration file and
download any libraries (jar files) that are required by the project
23. Anatomy of a new project
Note: dashes in project names are converted to
underscores to make Java happy!
27. Version your project with Git
cd my-project
git init
Create a repo on github & add it to your project
git remote add origin
git@github.com/account/project.git
git push -u origin master
You may want to edit your .git-ignore file also
29. project.clj - project definition
Lein deps will check this project.clj configuration file and
download any libraries (jar files) that are required by the project
36. Fire up the REPL in Emacs
M – x
clojure-
jack-in
M – x represents the keyboard combination of the meta key followed by x.
Then the command clojure-jack-in is entered.
54. Uses your Leiningen project.clj
- Create your account & install the toolbelt
- Create your instance
- Push your git repo
- Fire up your browser
blog.raynes.me/blog/2011/11/03/moving-try-clojure-
to-heroku/
devcenter.heroku.com/articles/clojure-web-
application