David Chandler's Journal of Java Web and Mobile Development

  • David M. Chandler

    Web app developer since 1994 and Google Cloud Platform Instructor now residing in Colorado. Besides tech, I enjoy landscape photography and share my work at ColoradoPhoto.gallery.

  • Subscribe

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 223 other followers

  • Sleepless Nights…

    August 2010
    S M T W T F S
  • Blog Stats

    • 1,033,666 hits

The ultimate file browser for maven repos and more

Posted by David Chandler on August 26, 2010

Recently, I’ve been doing a lot of work with maven where I needed to verify that the correct artifacts were deployed to a maven repository. While it’s easy enough to view a maven repo in a Web browser, it’s a pain to click through all the levels, and the POMs don’t show up very nicely due to the XML content.

So, I reached way back in time in my toolbox and pulled out lynx, the text-only browser created at my alma mater the year I graduated. (Ironically enough, I was then unaware of HTTP and lamenting that all the interesting work in EE had already been done. I had even used the Internet, as my wife and I would telnet across state lines with our campus VAX accounts to chat on the VT220 terminals in our respective dorms. But I didn’t see the Web coming, and it’s most of what I’ve done for the last 18 years…).

You can quickly browse maven central, for example, using

lynx https://repo1.maven.org/maven2/

For extra speed and the ability to look at POMs in vi, pull in the HTTP repo first (POMs only for speed) with wget:

wget -r -l3 --no-parent https://repo1.maven.org/maven2/com/whatever -A.pom

Now for the really fun part. Inspired by the ability to launch Finder on the Mac with “open .”, I tried

lynx .

Sure enough, lynx has finally cured my emacs file browser envy. Use the arrow keys to navigate, “o” to set options, including vi as your editor, then “/” to search just like in vi and “e” to edit any file. If you have to edit a bunch of files in multiple directories, this definitely trumps tedious “cd” and “vi” commands, even with shell filename completion. For really hardcore users, there’s

lynx -vikeys .

Of course, all this would be unnecessary if the Mac Finder worked a little more like Windows Explorer. Or if I’d learned emacs instead of vi.

For a real blast from the past, pull up the Google home page with lynx. Even Gmail works! I love text, I really do. Although, for the record, I do much prefer GMail and GCalendar in Chrome with keyboard shortcuts on.

2 Responses to “The ultimate file browser for maven repos and more”

  1. Per Wiklander said

    You do know about Midnight Commander, don’t you? For file management and browsing, that is. It can of course use lynx (or links) as the viewer for the kinds of files that benefit from that. And VI or whatever as editor and why not handle the rest with “open”?

    On a mac it can be installed using one of the package managers like Homebrew (find it at github), Fink or MacPorts (where Homebrew is the cool new kid on the block).

    • perwiklander said

      Heh, funny. I (re)read this article today and thought I’d leave a comment and mention the great file manager MC… looks like a case of “been there, done that” šŸ™‚

      I’ll at least point out that if you like “lynx”, then “links” should make you even more happy.

      Your link to the maven repo has https in it, I don’t see any repo there, but http works fine.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: