The Lurker

Latest posts | Archive

posted by ajf on 2002-11-12 at 12:41 pm

I can feel a rant coming on...

One little thing that I really liked about Orion is that there was no fucking around to run it: java -jar orion.jar is as simple as it can get.

The Windows batch files and Unix shell scripts that come with the Centipede and Maven build tools have been causing me grief again. They're absurdly complicated because they try to do too much. Most of the trouble seems to come from trying to be "clever". Just now the Maven batch file fell over because the Cygwin bin directory is in my path before the Windows directory. Maven tries to use the find command to ensure that the MAVEN_HOME environment variable actually points to a directory which exists. Because Cygwin has the Unix find command (same name, completely different purpose), it fell over.

Right now I'm pissed off because my MAVEN_HOME environment variable is pointing exactly where it fucking well should be, thank you very much. If they hadn't been trying to hold my hand as though I'm a fucking toddler crossing a major highway, it wouldn't have fallen over. It doesn't help that they have to maintain two-and-a-half scripts; one for Unix, and one which has to figure out whether it's running on DOS command.com or NT's cmd.exe (which is preferable, but not available on Win9x) and use different commands accordingly. And I've found these batch files tend to be rather fragile; if your system isn't quite set up the way they expect, things just fail. If you insist on holding my hand, why not write code that will actually run properly? I can't fault the Maven developers for my Cygwin path problem (a batch file will always fail if it depends on an executable it can't find, there's not much they can do about that); but there was no need for the check in the first place.

It's quite simple. The batch file, if there must be one, should do nothing more than java -jar %MAVEN_HOME%\lib\maven.jar %* (or the equivalent command.com code). On Unix, they need do no more than recommend alias thing='java -jar $THING_HOME/coolthing.jar'. If MAVEN_HOME isn't set properly, the user will see a "No such file or directory" error message, which is a pretty good hint that it couldn't find maven.jar, which probably means MAVEN_HOME isn't right. (And anybody who is too stupid to figure that out is too stupid to be running a build tool.) Anything else that needs checking can be checked in Java code.

Related topics: Rants Java

All timestamps are Melbourne time.