Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8948533
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T13:01:02+00:00 2026-06-15T13:01:02+00:00

I used to like to include all of clojure.contrib, and require all the libraries.

  • 0

I used to like to include all of clojure.contrib, and require all the libraries. This makes find-doc useful as a discovery tool.

Nowadays (clojure 1.4) clojure.contrib is split into many sub-libraries. And that rather spoils my scheme, and it also means that I am constantly having to restart the JVM every time I need a new library.

So I’m busy constructing a project.clj file with many lines:

[org.clojure/algo.generic "0.0.6"]
....
[org.clojure/data.xml "0.0.4"]
....

So that I can get leiningen to put every clojure contrib library on the classpath, whether I need them or not.

And I reckon that this is going to be a spectacular pain in the neck, what with the version numbers, and all.

And I wonder if anyone has a better way to do the same thing?

EDIT: Thinking about it, if there’s a web page somewhere that has a list of library names and current versions, I can turn that into a project file fairly easily.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T13:01:03+00:00Added an answer on June 15, 2026 at 1:01 pm

    You could use pomegranate if you just want to run it in the REPL (which seems like it would be the only appropriate use case, right?). You can have it look up the latest versions using the Maven Central API. I think this is better than maintaining some sort of dependencies project, generated or otherwise.

    (require '[cemerick.pomegranate :refer [add-dependencies]])
    
    (add-dependencies
      :coordinates '[[clj-http "0.5.8"]]
      :repositories {"clojars" "http://clojars.org/repo"})
    
    (require '[clj-http.client :as client])
    
    ;; contrib project names from https://github.com/clojure
    (def contrib ["tools.nrepl" "tools.trace" "tools.namespace" "tools.macro"
                  "test.generative" "math.numeric-tower" "core.match" "core.logic"
                  "data.priority-map" "core.contracts" "tools.cli" "java.jmx"
                  "java.jdbc" "java.classpath" "data.xml" "data.json" "core.unify"
                  "core.incubator" "core.cache" "algo.monads" "data.generators"
                  "core.memoize" "math.combinatorics" "java.data" "tools.logging"
                  "data.zip" "data.csv" "algo.generic" "data.codec"
                  "data.finger-tree"])
    
    (defn add-contrib-dependencies
      "look up the latest version of every contrib project in maven central,
       and add them as dependencies using pomegranate."
      [project-names]
      (add-dependencies
       :coordinates
       (map (juxt
             (comp symbol (partial format "org.clojure/%s"))
             (fn [proj]
                 (Thread/sleep 100)
                 (-> "http://search.maven.org/solrsearch/select?q=%s&rows=1&wt=json"
                     (format proj)
                     (client/get {:as :json})
                     :body :response :docs first :latestVersion)))
            project-names)))
    

    Now you can just invoke this function on the list of project names:

    user=> (add-contrib-dependencies contrib)
    {[org.clojure/data.zip "0.1.1"] nil,
     [org.clojure/java.classpath "0.2.0"] nil,
     [org.clojure/core.cache "0.6.2"] nil, ...}
    

    UPDATE: as suggested earlier, I had made this answer into a library. It can be used either as nREPL middleware or invoked manually from a running REPL session. The code can be found at https://github.com/rplevy/contrib-repl, where usage instructions can also be found.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have used code like this: http://msdn.microsoft.com/en-us/library/dw70f090.aspx to access database before when working in
Becase I've seen (and used) situations like this: In header.h: class point { public:
I've got 3 connectionstrings in web.config, and I used theirs like this: using (SqlConnection
I have used Javascript onlaod like this: function check() { var pic = new
Goal: an scss (I'm using v3.2.1) mixin preload used like this (for any number
I have several large enums that are used like switch(someEnumValue) { case SomeEnum.Value1: DoSomething();
I want to add Emails to navigation so It can be used like any
I have used commands like Top and also tools like Traceview to understand the
I installed a new version of Apache server, I used options like --with-PACKAGE to
I have lets say a WeeklyViewUserControl.xaml and a DailyViewUserControl.xaml. Normally I used stuff like

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.