The UnknownHostException and A Not-so-obvious Cause

Monday, June 9th, 2008

The past week has turned out to be the week of “all sorts of weird problems” for me. One of the issues I ran into was that, in a new Ubuntu installation, maven fails to download artifacts from the repository server. After some arm-twisting with maven (people really should start logging the actually exception instead of just printing “unable to download artifact…”), I was able to pinpoint the underlying problem to be an UnknownHostException from trying to resolve the repository server. The strangeness of the situation is, I can access the repo and download the same artifact with firefox, wget, or anything non-java. I can also resolve the repo server name just fine with nslookup. more…