ONJava.com’s Top 15 Ant Best Practices is a good read. Speaking as someone whose new build files tend to be copied and hacked about from existing projects, I really should pay more attention to my poor neglected ant files. I especially liked the recommendation to use zipfileset
to create archives, as it means you don’t have to create temporary directory structures prior to creating your JAR, WAR and EAR files – something I do quite a bit.
4 Responses to “Ant best practices article”
Take a look at megg [ http://megg.sf.net ] which I wrote to take care of this very problem (hacking old projects up for build files), try the simple “java -jar megg.jar java” example 🙂
enjoy.
jez.
I’ve been meaning to look at megg for a while now – I guess I should get of my bum and take a look…
I have used megg and love it but I don’t see how megg compares to Ant… they complement each other. Maybe megg does more than I think and what I use megg for. I like megg for creating a build environment for users of web frameworks. Sometimes distributions make no sense and CVS directory structure is even worse, megg takes care of that for me.
Quite right Kris, I didn’t want to imply that megg could replace Ant, quite the opposite, I’m trying to encourage the use of Ant and other best practices, with megg as a quickstart thingmybob. I’m glad you love megg, must take a look at that framework you pointed me towards, it didn’t look like an ‘open’ framework (forgot name, sorry too many xmas parties) but if I can get a HelloWorld stylee thing working in it, and it looks like a good framework, I’d love to include it (I really wish I could remember its name)
Maybe over the xmas break I’ll revist the core of megg, rather than the templates, see if I can add some of the funky things I’ve been thinking about (on the backburner) for it, especially allowing user templates, and cool template creation guides etc…
anyways merry xmas…
jez.