This is a web project that I wrote primarily to learn Clojure (and Clojurescript!). It's very alpha and so a little rough around the edges, but as I have time and/if there's any interest, I'd be happy to add more functionality.
Itch: You are working with Maven and would like a helpful view of all the jars and classes on your project's classpath.
Scratch: When this webapp is started from within a directory that is a maven project, it will use the pom to find jar dependencies and then display a nice web page that allows you to browse and search the classes that are being included the classpath by maven.
Watch a 3 minute video of how to use inside you're maven project:
Contains clojure serve side code
Server side unit tests
Stuff used by server unit tests
Contains clojurescript client side stuff
Contains the sass stylesheets. These are automatically converted to css files inside resources/public/stylesheets
Static resources that are all bundled up and included in the
war. Stylesheets are generated from
src/main/cljs. Html is generated
by exporting serve haml views.
Start Compojure Web Server
lein ring server
Run Unit tests
Start a Clojure REPL
Then, in emacs:
Outside of Emacs (but why?!!!):
Find all jars on classpath
Search for jar by name
Find all classes in a jar
REST (wip, need to finish)
Searches inside jars in pom.xml for class by name
Search for classes within jars
(get-classes-in-zips [jar-file1 jar-file2] ... etc)
/rest/classes?jars="path-to-jar1,path-to-jar2,etc.." or filter by class name: /rest/classes?jars="path-to-jar1,path-to-jar2,etc.."&search="Appender" or filter AND page the results /rest/classes?jars="path-to-jar1,path-to-jar2,etc.."&search="Appender"&offset=20&max=20
Front End (Clojurescript, Sass, Haml)
I'm using a few technologies here including Clojurescript, and a ruby gem called "Serve" (that uses haml, and sass).
Ruby Serve Project
This is also a Serve project just for convenience of having compass,
sass and haml available. Run
serve at the command line and then
browse to port 4000.
serve export . resources/public, then rename haml files to
The haml files can then use the the js. You can also play around with cljs files inside a cljs browser repl (use browser-repl shell script, or, in emacs, call inferior-lisp with it set to use browser-repl).
Building and deploying
At this point, you can use the
serve command to play around with
stylesheets and html layouts
This exports stuff out of serve and puts it into resources/public/ so that it can be used by the java webapp.
At this point you can run the java webapp using
lein ring server
Change the version in project.clj and maven-project/pom.xml.
lein ring uberwar
Deploy as Maven Plugin
Copy the uberwar to
src/main/resources/javabrowser.war, then cd into
maven-plugin and do a
Use locally as maven plugin
At this point, you can add it as a maven depencency to local projects like this:
<build> <plugins> ... <plugin> <groupId>com.upgradingdave</groupId> <artifactId>javabrowser-maven-plugin</artifactId> <version>x.x.x</version> </plugin> ... </plugins> </build>
Ideas for future versions
Make all class and interface names in class details click thru links
Add ability to drill down into source code using maven capabilities
Add ability to toggle between runtime, test and provided scopes
Maybe make it a hosted webapp where (in addition to local maven plugin)? People could search for jars similar to findjars website and then have ability to search and inspect classes.
Version 0.0.3 (Released Oct 31 2011)
Figured out how to use requiresDependencyResolution to include project's depenendencys inside the custom mojo.
Added more features for parsing maven pom.xml such as ability to replace property tokens
Converted jquery to clojurescript
Changed UI to use combo box to select jars, then changed back to use list. Learned a lot about google closure widgets ;-)
Fixed relative file path so it works in prod jar and in lein ring server (sort of)
Copyright (C) 2011 Dave Paroulek (upgradingdave.com)
Distributed under the Eclipse Public License, the same as Clojure.