Skip to content

Tag Archives: ant

Go with the grain

Go with the grain. When you’re planing wood, you have to follow the grain of the wood. The grain has a direction, which depends on the cut of the wood. (which is the way it grew). Do that and you’ll end up with thin shavings and a smooth finish.. Go against the grain, and you’ll [...]

Supporting Multiple Environments – Part 3

Supporting Multiple Environments – Part 3 (part one and two) In this installment, I’m going to cover the configuration storage mechanism for this separate configuration jar approach. Configuration Storage With the approach listed in step two, it’s easiest to manage the actual values via property files, stacked up in a layered approach.  Here’s what we [...]

Supporting Multiple Environments

One of the longest running debates I’ve watched in the Maven community over the years, is how to best support different configurations for different deployment environments (where “deployment environment” means a QA environment or staging environment – anything other than a local developer build). Some people argue simplicity over the complexity of some of the [...]

Ant 1.8.0 released

The Apache Ant team just announced Ant 1.8.0.  The most stunning change is that of lexically scoped local properties.  Now, you can keep a property scoped to a target, or a sequential block.  Hopefully this will mean poeple rely less on ant-contrib.   Many people appear to misunderstand the Ant properties mechanism; maybe they are [...]

Ant Contrib: the power and the pain

I got a comment from Errno on my last post: “Everyone agrees that Ant Contrib means you’ve done something wrong.” why? is there any blog post/write-up describing this? thanks I don’t know of any write-up. So I’ll make one. There’s a reason why some tasks are in ant-contrib and not the Ant tool proper: they [...]

Better Apache Ant Builds

Abstract: We did two CITCON sessions here; Joe Schmetzer suggested a show-and-tell about tools to reduce Ant bloat, and Ivan Moore wanted a general session on improving the quality of Java builds in general. During the conference, the two sessions merged. My plan was to sit in and tweet smart-ass comments. As I had my [...]

Apache Ant script reuse

The Maven guys have got one thing (and others, I’m not being mean) right – we reinvent the wheel too much on Java projects. Joe Schmetzer has an Ant Script Library. And Pascal here has had a crack at the problem of Ant Script reuse. Seems a bit 2002-esque to write an Ant build from [...]

Build Refactoring: Delete Boolean Property

(image taken from Kurtis Scaletta’s photostream) Last time, you read about the extract target refactoring. Today, I’m going to show you one that I love to perform: delete boolean property. Have a look the smell first: <project default="unit_tests"> <property name="junit.enabled" value="true" /> <target name="-check_junit_enabled"> <condition property="junit.really.enabled"> <and> <equals arg1="${junit.enabled}" arg2="true" /> </and> </condition> </target> <target [...]

Build Refactoring: Extract Target

Your build files probably need some TLC. Sorry. It’s true. If you’re lucky enough to work on a project with clean code (and let’s face it, most codebases aren’t too pretty), then you’re even luckier to have a nice clean build. Wait! Don’t go getting upset, I can help you. I’ll be introducing some build [...]

The Build Rosetta Stone

Update: I had some nice feedback from @jtf @nasrat and @cread, so I have pushed the source files to a git repository. What’s the equivalent command to [some command in your usual build tool] in [some build tool that you're using now]? I found myself asking that question too often earlier this year, so I [...]