❯ Guillaume Laforge

Build

Maven tip: using Ant's optional FTP task

Maven is a pretty powerful tool, but sometimes, simple things can get complicated… I had to customize my build to upload some files through FTP. But it wasn’t just a mere artifact to upload through FTP to the enterprise repository, so I couldn’t use Maven’s artifact plugin and its FTP method. So the solution was to use Ant’s optional FTP task. At first, it doesn’t seem very complicated, since Maven can basically use any Ant task very easily, but the fact is that this optional Ant task is dependent on another library that you have to add to Maven’s root classloader, otherwise you’ll get a NoClassDefFound! Read more...

Some good rules for an efficient ant build script

Some time ago I came across an interesting article on Apache’s wiki entitled (Apache Wiki: The Elements Of Ant Style. It’s a very thourough overview of good practices for writing clean, readable, reusable and efficient Ant build files. Today, through magpiebrain, I read on OnJava another very interesting and concise article giving 15 Ant best practices. It’s much shorter than the previous article on Apache’s wiki, but still, with those 15 practices you’ll manage to improve some messy build scripts. Read more...