25 August 2012

Adding jars to local repository with Leiningen

Last night I thought I should experiment a little with Enlive, an html library written in Clojure. Enlive makes it very easy to scrape web-pages, apparently.
However, I could not find a jar for Enlive in the central Maven repository, neither was there one in Clojars. I did find some that other people had built, but I never trust strangers on the net. ;) So I figured I should build it myself and put it in my local Maven repository. This is how I did it:

First clone the repository from Github

git clone https://github.com/cgrand/enlive.git
Then build it with Leiningen

cd enlive
lein install
Now, this install the pom-file to my local repository, but it won't put the jar in the repository. At this point I was contemplating using Maven to install the jar, or even manually renaming and copying the jar to the correct folder in the repository but I thought that surely Leiningen must have a way to do this.

So I found a plugin to do it. Shantanu Kumar has made a plugin (lein-localrepo) for exactly this purpose. I am using Leiningen 2 so I added lein-localrepo to my ~/.lein/profiles.clj:

{:user {:plugins [[lein-localrepo "0.4.0"]]}}
After that I could use the handy coords command pointed at my generated jar to find Maven coordinates for the jar and pipe them into the install command to put the jar at the correct position in my local repository.

> lein localrepo coords target/enlive-1.0.1.jar
target/enlive-1.0.1.jar enlive/enlive 1.0.1

> lein localrepo coords target/enlive-1.0.1.jar | xargs lein localrepo install

WARNING: using numeric exit values in plugins is deprecated.
Plugins should use leiningen.core.main/abort instead.
Support for this will be removed before the stable 2.0.0 release.
localrepo failed.
I do get an error message, but the install command completed successfully anyway. Now on to scraping some web pages.


  1. I already somehow experimented in this way!))) That then I could not open any jar file! I had to immediately seek a solution on the Internet. Thank God, that I found a good website, with the help of which I managed to open jar file https://wikiext.com/jar. After that I decided, that I will no longer be so experiment!)))

    1. Great Article
      Cloud Computing Projects

      Networking Projects

      Final Year Projects for CSE

      JavaScript Training in Chennai

      JavaScript Training in Chennai

      The Angular Training covers a wide range of topics including Components, Angular Directives, Angular Services, Pipes, security fundamentals, Routing, and Angular programmability. The new Angular TRaining will lay the foundation you need to specialise in Single Page Application developer. Angular Training

  2. Amazing & Great informative blog,it gives very useful practical information to developer like me. Besides that Wisen has established as Best Java Online Training India . or learn thru Online Training mode Java Online Training From India . Nowadays Hibernate ORM has tons of job opportunities on various vertical industry.

  3. This is a good post. This post give truly quality information. I’m definitely going to look into it. Really very useful tips are provided here. thank you so much. Keep up the good works.
    python Online training in chennai
    python Online training in bangalore
    python interview question and answers

  4. Some us know all relating to the compelling medium you present powerful steps on this blog and therefore strongly encourage contribution from other ones on this subject while our own child is truly discovering a great deal. Have fun with the remaining portion of the year.
    Data Science Training in Chennai
    Data Science course in anna nagar
    Data Science course in chennai
    Data science course in Bangalore
    Data Science course in marathahalli

  5. Very nice post here and thanks for it .I always like and such a super contents of these post.Excellent and very cool idea and great content of different kinds of the valuable information's.
    rpa training in bangalore
    best rpa training in bangalore
    rpa training in pune | rpa course in bangalore
    rpa training in chennai

  6. Your good knowledge and kindness in playing with all the pieces were very useful. I don’t know what I would have done if I had not encountered such a step like this.
    Best Devops Training in pune
    Devops Training in Bangalore
    Microsoft azure training in Bangalore
    Power bi training in Chennai

  7. Have you played gambling for a long time? Come to us and win right away. good luck on your side. best slots game online .Good luck does not turn away from you, take risks and win.

  8. You have provided a nice article, Thank you very much for this one. And I hope this will be useful for many people. And I am waiting for your next post keep on updating these kinds of knowledgeable things
    Java Training in Chennai
    Java Training in Coimbatore
    Java Training in Bangalore

  9. Nice blog, this blog provide the more information. Thank you so much for sharing with us.

    Nice blog, this blog provide the more information. Thank you so much for sharing with us.
    aws Training in Bangalore
    python Training in Bangalore
    hadoop Training in Bangalore
    angular js Training in Bangalore
    bigdata analytics Training in Bangalore
    python Training in Bangalore
    aws Training in Bangalore

  10. Some us know all relating to the compelling medium you present powerful steps on this blog and therefore strongly encourage contribution from other ones on this subject while our own child is truly discovering a great deal. Have fun with the remaining portion of the year.
    hadoop training in chennai

    hadoop training in omr

    salesforce training in chennai

    salesforce training in omr

    c and c plus plus course in chennai

    c and c plus plus course in omr

    machine learning training in chennai

    machine learning training in omr

  11. Every person, from a child to an 80-year-old man, use the facilities the technology has provided us. Along with this, the increase in population has also played a big role in the tremendous growth of information technology. data science course syllabus

  12. Wow what a Great Information about World Day its exceptionally pleasant educational post. a debt of gratitude is in order for the post.
    data science course in India

  13. This was a very informative article, indeed loved to read and clear my doubts. Keep us posted a lot more blogs. Also check out our blog pages too.

    data science training in chennai

    ccna training in chennai

    iot training in chennai

    cyber security training in chennai

    ethical hacking training in chennai

  14. Thank you for sharing your info. I really appreciate your efforts and I am waiting for your next post thank you once again.
    AWS certification course in Chennai

  15. Very Good
    This blog is interested

  16. First of all, download Adobe XD CC Crack. · Extract the archive using Winrar software on your PC. · Run the setup.exe file from the extracted files. · Continue .Adobe XD Crack Version

  17. Better Half Wife Birthday Card - Birthday Wishes For Better Half Wife, HD Png Download is free transparent png image. To explore more similar hd image on .Birthday Beautiful Quotes

  18. Little says that some people will argue that certain candle colors work best for certain needs. “Brown is great for grounding, green is great .How-To-Manifest-With-Candles/