Maven is good, but needs some love
You know that I've moved to Maven more than one year ago and I don't regret. I think I would be unable to manage the number of projects I'm managing on my own without it (or at least without an effective artifact repository).
But Maven needs a proper and clean environment. Maven experts are constantly advising about that. One of the most important pieces of the environment is the artifact repository. You can create a cheap one with a plain webdav resource, or you can install a specific tool such as Nexus or Artifactory. A plain webdav resource is simpler to manage and might sound as a good solution for simpler cases, while a specific tool is more powerful but more complex to setup and administer. It's your choice: the important thing is that everything is under your control and properly managed.
Hear what's happening to me since a couple of days. Before going on, I'll recap a couple of Maven concepts. When you have a multi-repository project (unfortunately it frequently happens, as some libraries you might depend have their own repo), Maven searches for artifacts in all of them - what typically happens is that the first repo responds with an HTTP 404 - Not Found and Maven searches on until it finds what it needs. Then it stores a metadata XML file to recall where it has last found the artifact. In this way it can avoid constantly polling for things and it's faster.
Now, I have still a few remaining messy things in my projects. When I made the switch one year ago, I thought that a webdav repo was ok for my stuff and used the webdav facility at Kenai. Later I realized that Nexus was worth while, and in any case I was able to deploy most of my stuff to the free Sonatype Maven hosting. But I have still three projects relying on Kenai's webdav. I planned for moving them sooner or later, but I didn't so far because I didn't touch them for some months.
Now, a couple of days ago, Kenai started randomly responding with a small text page saying HTTP 500 - Internal Server Error instead of the HTTP 404 when you ask for a non-existing resource - but the status code is set to 200 so Maven and Nexus
, that clearly aren't much smart sometimes, instead of treating this as a "not found", are accepting the resource that is served with the error. The resource, of course, is a small HTML page with the text "Internal Server Error" etc... Of course, storing this as an artifact, a POM, or a metadata XML file isn't good at all and breaks the build. In a couple of days, the error literally poisoned all my repositories, both Nexus and the one on my disk, and all my builds are broken. Now I'm compelled to fix the thing ASAP - and I'm forced to postpone my next release of blueBill, since this week will be focused on the required clean up.
Clearly, it's not
entirely a Maven fault (even though that silly way of handling HTTP 500 is crying out loud); the problem originated from Kenai and a messy situation in my software factory. With Maven, you must be very precise and accurate. You can take this as an annoyance - on the other hand it's also a stimulus for setting up things properly. I do hope that the next release of the Maven tools, anyway, will have this sort of silly bugs fixed.