Struggling with Ant Build Dependencies

java-logo-thumb.png

Well... today I lost about an hour messing around with some code I had refactored to make a little factory of sorts so that it could be shared amongst two classes that had no common class ancestry. It was that or a lot of copy-n-paste, and there was just too much code to do that. So I did the refactoring and then a lot more coding and then hit the tests.

It wasn't the coding, but the testing that gave me fits. Specifically, because I did so many changes, I just did the standard Ant build and then deploy to the Tomcat server. There was a problem in setting this trigger on an H2 in-memory table, and for the life of me, I could not figure out why.

So I dug into the code, and what I found was that I was the victim of incomplete dependency checking by Ant. I should have rebuilt a few more classes that were effected by the refactoring, but Ant wasn't smart enough to do that. I'm not complaining, but when I look at Ant, I really see something made by a group of people that didn't like Makefiles.

I've used Makefiles for years and it's a far better system than Ant - even for Java, and while it doesn't claim to do dependency checking on it's own, there are tons of tools to create those dependency checks that are air-tight in their completeness.

So once I did a clean build, things started working again for me. It's something that I've had long conversations about with friends - the way the Java Lobby seems to be unsatisfied with the existing state of things, and rather than just make a 'makedepends' for Java, they have to XML-ize it, and make a new Java-based, Java-built tool that claims to do these things, when it really only does them slightly worse than the 20-year old tools that everyone else knows.

It's what I dislike most about Java. Not the language, but the people that are it's fanatical following. Spring, Faces, J2EE, the list goes on and on.