Thursday, December 15, 2011

Maven. Just...Maven

It has come to my, it has been forced to my attention, that maven is even more interesting than I knew.
It can download poms and jars and shit from repositories. Well, that's a known fact. The new brilliantly interesting part is the 'shit'. Maven will say hello and please give me a pom or a jar to a repository website; and the repository might say ok, well, I've been moving around, here's a redirect to my new location, and then the new location might be the web page for humans of the repository, and maven is not human, so it can't read that page, and will download it in place of the jar or pom.

It will know that the data is invalid. But it is polite and will say thank you repository website, and just like all us millions of humans at christmas, it will definitely not refuse the kind gifts, but actually keep it. It will warn me that it is invalid, but, it will definitely store it, and not try to replace it. So you have to do it manually. cd .m2/, find . | grep shit, rm -rf repository/that/shit. Or just erase the whole of .m2/repository. Or make that the whole .m2/, you might have old and stale settings.

Maybe there is some 'clean-up' command. Or maybe not.

Well, sort of what you can expect when trying to build a project that hasn't been built for a year or so -- there is something called bit rot.

So...back to solving the other upwards of a hundred 'Missing artifact' errors. Parting advice: avoid dependencies :)

Returning 403 is also not a good idea (not the same repo). Is this bad luck, or what? Two repositories each breaking the build.

No comments:

Post a Comment