Saturday, 23 June 2007

Maven depgraph plugin: getting a better picture of your Maven dependencies

Dependency management has always been a beeyotch, and it's only gotten
worse over the years. This library needs that and that and that
library, and another jar needs that and that jar. Then you could get
one jar depending on an older version of another jar, and another
requiring a newer one. God knows this leads to simple webapps that
only have 4 classes but so many dependencies that they balloon to 14Mb
.war files!

Maven has been a big help in managing this, but the introduction of
transitive dependencies in Maven2 has also resulted in the developer
knowing even less about what libraries are being used. Granted, the
whole thing saves you from having to specify each and every one of
those dependencies, but the fact you had to do it also meant you at
least *knew* what was going in there. And if there were any errors due
to conflicting library versions, you didn't have to trawl through as
many directories to find out what the conflict was. In Maven2, this
pretty much means you have to go through the .pom files in your
repository, whereas in Maven 1 you just had to look in your project's

Anyway, I came across this blog post about a maven plugin that
generates a diagram showing your maven dependencies:

It uses the very useful GraphViz ( to create
the images.

It should be as easy as running:

mvn depgraph:depgraph

Sadly, I couldn't get it to work on my PC. Looks like there's a
parameter you pass in so the plugin knows your local repository -
which is kinda strange, since shouldn't it be able to get this from
Maven, which obviously *would* already have this information? The
parameter "m_localRepository" is a required parameter but the plugin
site (
lacks examples of the proper usage. I mucked around and *seemed* to
get it working with a call to:

mvn depgraph:depgraph -Dm_localRepository="C:\localrepository"

But again, that didn't work. One of these days I'll get it working,
but looming deadlines require my attention on more immediate things to


Wednesday, 20 June 2007

Resolved: stick to Log4j for logging

A pretty clear reason why if it ain't broke, don't fix it.

" The purpose of Commons Logging is not to isolate your code from
changes in the underlying logging framework. (That's certainly easy
enough to do on your own, and not really worth doing in the first
place given the ease of switching from one logging framework to
another.) The purpose of Commons Logging is not to somehow be more
useful than actual logging frameworks by being more general. The
purpose of Commons Logging is not to somehow take the logging world by
storm. In fact, there are very limited circumstances in which Commons
Logging is useful. If you're building a stand-alone application, don't
use commons-logging. If you're building an application server, don't
use commons-logging. If you're building a moderately large framework,
don't use commons-logging. If however, like the Jakarta Commons
project, you're building a tiny little component that you intend for
other developers to embed in their applications and frameworks, and
you believe that logging information might be useful to those clients,
and you can't be sure what logging framework they're going to want to
use, then commons-logging might be useful to you."

Tuesday, 19 June 2007

Tomcat Native library

While working in IntelliJ and running Tomcat, I came across this message:

INFO: The Apache Tomcat Native library which allows optimal
performance in production environments was not found on the
java.library.path: C:\Program

I'd never heard of this library before, so I had a look around and found this:

The file is called tcnative-1.dll and is here:

I placed it in WINNT\System32 and all is sweet. Not that I'd notice it
much, but startup seems to have decreased from 4 to 2 seconds. :P

Saturday, 16 June 2007

Launchy - application launcher for Windows, similar to Spotlight on OS X.

I've been looking for a tool similar to Spotlight on OS X that allows
you to start applications by just typing their name. Finally came upon
one - Launch @

Just type Alt-Space to bring it up, then type the program name.

Much much better than screwing around with the Start Menu programs list.

(and yes, I know Spotlight does so much more than this)