SlideShare a Scribd company logo
L e in in g e n 2
    H u m a n e b u ild
  m a na g e m e n t fo r




ClojureMadeSimple.co.uk
slideshare.net/jr0cket
  This slide deck is available to follow along with on slideshare.net
Leiningen2 - humane build management for clojure
Leiningen2 - humane build management for clojure
of Java build
management
...there was Ant,
  Ant begat Ivy,
Ant begat Maven
… and there was much XML all around
Here end'eth the
     lesson..
(except of course this is just the end
          of the beginning)
Leiningen2 - humane build management for clojure
Leiningen2 - humane build management for clojure
Leiningen2 - humane build management for clojure
Leiningen2 - humane build management for clojure
Human verses Computer readable build jobs
build
management
Leiningen
      … more fun than Maven

… easy way to kick-start your Clojure
             addiction
Installing Leiningen
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
All the usual tasks,
               and then some
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
lein uberjar    Deploy your app & clojure
                 libraries
lein repl       Start the interactive shell (repl)
lein jack-in    Start repl server and connect (in
                 Emacs)
Fire up the REPL
              REPL: read, evaluate, print loop – dynamic
lein repl     environment for Clojure and other lisps
View function documentation

(doc map)
Show function source code
(source map)
REPL driven development




Develop functions and data structures on the fly


 REPL: read, evaluate, print loop – dynamic environment for Clojure and other lisps
Loading code into the REPL




Develop functions and data structures on the fly


 REPL: read, evaluate, print loop – dynamic environment for Clojure and other lisps
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
Anatomy of a new project
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
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
Open project in emacs

cd my-project
emacs project.clj
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
Dev Dependencies




Add libraries only needed for development
Not packaged when code deployed
https://clojars.org/
http://search.maven.com
Add a REPL server




REPL: read, evaluate, print, loop – dynamic environment for Clojure
and other lisps
Add REPL server to all projects

~/.lein/profiles.clj
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.
Define your own Global short-cut
Open your .emacs.d/init.el file and add:

(global-set-key
    (kbd "C-c C-j") 'clojure-jack-
 in)

In Emacs, start the REPL with

  C – c                 C – j
REPL in Emacs
Add web based REPL

  ~/.lein/profiles.clj




REPL: read, evaluate, print, loop – dynamic environment for Clojure
and other lisps
Leiningen WebRepl plugin
Local Repositories

  (just like Maven)
Libraries kept in local .m2 folder
Nexus / Artefactory repositories
https://github.com/technomancy/leiningen/blob/pr
  eview/sample.project.clj
Running your
  project
Create a new project

lein run
Runs the main function, or specify main with -m
 option
Long running processes
lein trampoline run
     -m my-stuff.server 5000
Running Tests

lein tests
lein tests my.proj.code
Deployment
Jars & Uber Jars
lein uberjar
Leiningen Plug-ins
Running scripts
   Copying files
    DVCS (git)
    Continuous
Integration server
     (Jenkins)
Leiningen2 - humane build management for clojure
Leiningen.org
      - Tutorials
- Github Repository
        - News
   - Bug reporting
Choose Life...




… choose Clojure
Th a n k yo u
      LondonClojurians.org



              @ r 0c ket
               j
 ClojureMadeSimple.co.uk
slideshare.net/jr0cket

More Related Content

PDF
JavaOne 2016 - Pipeline as code
PDF
funcs, func expressions, closure, returning funcs, recursion, the stack -goph...
PDF
Jenkins Pipelines
PDF
Cleaning Up the Dirt of the Nineties - How New Protocols are Modernizing the Web
PPTX
Pipeline as code - new feature in Jenkins 2
PDF
Native hook mechanism in Android Bionic linker
PPTX
SymfonyCon Berlin 2016 Jenkins Deployment Pipelines
PDF
Let's go HTTPS-only! - More Than Buying a Certificate
JavaOne 2016 - Pipeline as code
funcs, func expressions, closure, returning funcs, recursion, the stack -goph...
Jenkins Pipelines
Cleaning Up the Dirt of the Nineties - How New Protocols are Modernizing the Web
Pipeline as code - new feature in Jenkins 2
Native hook mechanism in Android Bionic linker
SymfonyCon Berlin 2016 Jenkins Deployment Pipelines
Let's go HTTPS-only! - More Than Buying a Certificate

What's hot (17)

PDF
sed.pdf
KEY
PyCon AU 2012 - Debugging Live Python Web Applications
PDF
Lcna 2012-example
PPTX
Version control system & how to use git
DOC
Cyb 225 cyb225 cyb 225 best tutorials guide uopstudy.com
PDF
Kernel Recipes 2016 - The kernel report
PDF
Kernel Recipes 2016 - Kernel documentation: what we have and where it’s going
PDF
Basic Gradle Plugin Writing
PDF
Использование Docker в CI / Александр Акбашев (HERE Technologies)
PPT
Implementing a Backup Catalog… on a Student Budget
PDF
DevOps Odessa #TechTalks 21.01.2020
PDF
NBIS RNA-seq course
PDF
Docker & ci
PPTX
Introduction to node.js
PPTX
04 02-2018--Slackware Wire Shark Installation
PPTX
Jenkins' shared libraries in action
PPTX
Prometheus: infrastructure and application monitoring in kubernetes cluster
sed.pdf
PyCon AU 2012 - Debugging Live Python Web Applications
Lcna 2012-example
Version control system & how to use git
Cyb 225 cyb225 cyb 225 best tutorials guide uopstudy.com
Kernel Recipes 2016 - The kernel report
Kernel Recipes 2016 - Kernel documentation: what we have and where it’s going
Basic Gradle Plugin Writing
Использование Docker в CI / Александр Акбашев (HERE Technologies)
Implementing a Backup Catalog… on a Student Budget
DevOps Odessa #TechTalks 21.01.2020
NBIS RNA-seq course
Docker & ci
Introduction to node.js
04 02-2018--Slackware Wire Shark Installation
Jenkins' shared libraries in action
Prometheus: infrastructure and application monitoring in kubernetes cluster
Ad

Viewers also liked (20)

PDF
Getting startedwith noir-clojureexchange-2011
PPTX
Salesforce Mobile Developer Week
PDF
Leiningen 2 - Humane build management for Clojure
PDF
Continuous delivery - JAX London 2011
PPT
Dreamforce 13 developer session: Introduction to Heroku
PDF
Get into Functional Programming with Clojure
PDF
Rave on communication
PPTX
Introducing the Salesforce platform
PPTX
Salesforce CCT Munich 2013 Introducing heroku - elastic, polyglot platform as...
KEY
Atlassian Developers switch to DVCS - Unite London conference
ODP
Perfect? clojure environment
PPT
Developers guide to the Salesforce1 Platform
PPT
Dreamforce 13 developer session: Git for Force.com developers
ODP
Getting started with Clojure
PDF
Git and github - Verson Control for the Modern Developer
PPTX
Introduction to Heroku - CCT London 2013
PPS
Saint valentin des oiseaux
PPS
Phares du.
PPS
Les sculptures de jean pierre augier-vg
PPS
Arbres en folie suz
Getting startedwith noir-clojureexchange-2011
Salesforce Mobile Developer Week
Leiningen 2 - Humane build management for Clojure
Continuous delivery - JAX London 2011
Dreamforce 13 developer session: Introduction to Heroku
Get into Functional Programming with Clojure
Rave on communication
Introducing the Salesforce platform
Salesforce CCT Munich 2013 Introducing heroku - elastic, polyglot platform as...
Atlassian Developers switch to DVCS - Unite London conference
Perfect? clojure environment
Developers guide to the Salesforce1 Platform
Dreamforce 13 developer session: Git for Force.com developers
Getting started with Clojure
Git and github - Verson Control for the Modern Developer
Introduction to Heroku - CCT London 2013
Saint valentin des oiseaux
Phares du.
Les sculptures de jean pierre augier-vg
Arbres en folie suz
Ad

Similar to Leiningen2 - humane build management for clojure (20)

PPTX
Intro to Clojure 4 Developers
PDF
Practical REPL-driven Development with Clojure
PDF
Practical Clojure Programming
PDF
Counterclockwise past present future
PDF
Clojure and Modularity
PDF
Clojure made-simple - John Stevenson
PDF
Clojure in real life 17.10.2014
PDF
Clojure - A new Lisp
PDF
Buildr In Action @devoxx france 2012
PDF
(Fun clojure)
ODP
Clojure made really really simple
PDF
Clojure forbeginners
PDF
Clojure class
ODP
Clojure made simple - Lightning talk
PDF
Introduction to clojure
KEY
(map Clojure everyday-tasks)
PDF
Clojure basics
KEY
A web app in pure Clojure
PDF
ClojureScript: The Good Parts
ODP
1.3 tools and-repl
Intro to Clojure 4 Developers
Practical REPL-driven Development with Clojure
Practical Clojure Programming
Counterclockwise past present future
Clojure and Modularity
Clojure made-simple - John Stevenson
Clojure in real life 17.10.2014
Clojure - A new Lisp
Buildr In Action @devoxx france 2012
(Fun clojure)
Clojure made really really simple
Clojure forbeginners
Clojure class
Clojure made simple - Lightning talk
Introduction to clojure
(map Clojure everyday-tasks)
Clojure basics
A web app in pure Clojure
ClojureScript: The Good Parts
1.3 tools and-repl

More from John Stevenson (20)

PDF
ClojureX Conference 2017 - 10 amazing years of Clojure
PDF
Confessions of a developer community builder
PDF
Progscon 2017: Taming the wild fronteer - Adventures in Clojurescript
PDF
Introduction to Functional Reactive Web with Clojurescript
PDF
Thinking Functionally with Clojure
PDF
Communication improbable
PDF
Getting into public speaking at conferences
PDF
Functional web with clojure
PDF
Guiding people into Clojure
PDF
Get Functional Programming with Clojure
PDF
So you want to run a developer event, are you crazy?
PPTX
Trailhead live - Overview of Salesforce App Cloud
PDF
Clojure for Java developers
PPT
Dreamforce14 Metadata Management with Git Version Control
PPT
Salesforce Summer of Hacks London - Introduction
PPTX
Heroku Introduction: Scaling customer facing apps & services
PPTX
Developer week EMEA - Salesforce1 Mobile App overview
PPTX
Building a great mobile experience on the force.com platforms
PPT
Heroku for-team-collaboration
PPT
Heroku for team collaboration
ClojureX Conference 2017 - 10 amazing years of Clojure
Confessions of a developer community builder
Progscon 2017: Taming the wild fronteer - Adventures in Clojurescript
Introduction to Functional Reactive Web with Clojurescript
Thinking Functionally with Clojure
Communication improbable
Getting into public speaking at conferences
Functional web with clojure
Guiding people into Clojure
Get Functional Programming with Clojure
So you want to run a developer event, are you crazy?
Trailhead live - Overview of Salesforce App Cloud
Clojure for Java developers
Dreamforce14 Metadata Management with Git Version Control
Salesforce Summer of Hacks London - Introduction
Heroku Introduction: Scaling customer facing apps & services
Developer week EMEA - Salesforce1 Mobile App overview
Building a great mobile experience on the force.com platforms
Heroku for-team-collaboration
Heroku for team collaboration

Recently uploaded (20)

PDF
How to Get Business Funding for Small Business Fast
PDF
kom-180-proposal-for-a-directive-amending-directive-2014-45-eu-and-directive-...
PDF
Solara Labs: Empowering Health through Innovative Nutraceutical Solutions
PDF
Katrina Stoneking: Shaking Up the Alcohol Beverage Industry
PDF
Elevate Cleaning Efficiency Using Tallfly Hair Remover Roller Factory Expertise
PDF
MSPs in 10 Words - Created by US MSP Network
PPT
340036916-American-Literature-Literary-Period-Overview.ppt
PPTX
CkgxkgxydkydyldylydlydyldlyddolydyoyyU2.pptx
PDF
20250805_A. Stotz All Weather Strategy - Performance review July 2025.pdf
PPTX
Dragon_Fruit_Cultivation_in Nepal ppt.pptx
PPTX
Principles of Marketing, Industrial, Consumers,
PDF
Power and position in leadershipDOC-20250808-WA0011..pdf
PPTX
Belch_12e_PPT_Ch18_Accessible_university.pptx
PDF
BsN 7th Sem Course GridNNNNNNNN CCN.pdf
PDF
WRN_Investor_Presentation_August 2025.pdf
PDF
Business model innovation report 2022.pdf
PPTX
Lecture (1)-Introduction.pptx business communication
PPTX
HR Introduction Slide (1).pptx on hr intro
PDF
How to Get Funding for Your Trucking Business
PDF
Stem Cell Market Report | Trends, Growth & Forecast 2025-2034
How to Get Business Funding for Small Business Fast
kom-180-proposal-for-a-directive-amending-directive-2014-45-eu-and-directive-...
Solara Labs: Empowering Health through Innovative Nutraceutical Solutions
Katrina Stoneking: Shaking Up the Alcohol Beverage Industry
Elevate Cleaning Efficiency Using Tallfly Hair Remover Roller Factory Expertise
MSPs in 10 Words - Created by US MSP Network
340036916-American-Literature-Literary-Period-Overview.ppt
CkgxkgxydkydyldylydlydyldlyddolydyoyyU2.pptx
20250805_A. Stotz All Weather Strategy - Performance review July 2025.pdf
Dragon_Fruit_Cultivation_in Nepal ppt.pptx
Principles of Marketing, Industrial, Consumers,
Power and position in leadershipDOC-20250808-WA0011..pdf
Belch_12e_PPT_Ch18_Accessible_university.pptx
BsN 7th Sem Course GridNNNNNNNN CCN.pdf
WRN_Investor_Presentation_August 2025.pdf
Business model innovation report 2022.pdf
Lecture (1)-Introduction.pptx business communication
HR Introduction Slide (1).pptx on hr intro
How to Get Funding for Your Trucking Business
Stem Cell Market Report | Trends, Growth & Forecast 2025-2034

Leiningen2 - humane build management for clojure