Jun 23 2009

[Quick Tip] Printing out all matches in an Ant fileset

Tag: ant,java,quicktippmularien @ 10:17 pm

This is one of those things that’s so handy, I can’t believe it hasn’t been posted before. I found a 2006 post from JavaLobby, where R.J. Lorimer writes about how to print out a classpath.

Also useful, but the particular use case I ran into was – one of our build scripts uses a fileset to select incrementally more complex test suites to run. Developers can do a quick check locally with the “short tests” – however, since these are specified as a fileset, it’s hard to know exactly what will run. I wanted to create a simple ant task to take the fileset, and print out everything that matched.
Continue reading “[Quick Tip] Printing out all matches in an Ant fileset”


Jan 18 2008

Quick Tip: Using an authenticated proxy server with Ivy

Tag: ant,development,ivy,java,spring,springwebflow,webpmularien @ 8:25 am

I was recently checking out the sample applications that ship with Spring Web Flow 2.0. In order to build the examples, you have to run an ant build that involves the Ivy Dependency Manager.

I was doing this behind a proxy server which requires username/password authentication, which unfortunately isn’t documented in the Ivy FAQ.

In case anyone runs into this particular problem, here’s how I solved it. Set the following environment variable (note this is all on a single line – I’ve added line breaks for readability):

set ANT_OPTS=-Dhttp.proxyHost=myproxyhost -Dhttp.proxyPort=8080 -Dhttp.proxyUserName=myproxyusername -Dhttp.proxyPassword=myproxypassword -Dhttps.proxyHost=myproxyhost -Dhttps.proxyPort=8080

Replace as appropriate for your environment.


Jan 03 2008

Quick Tip: Using “Ant Builder” to customize Eclipse builds using ant scripts

Tag: ant,development,eclipse,javapmularien @ 11:09 pm

Recently, while working on a customer’s older EJB 2-based system, I was going a bit nutty having to run a 1-2 minute ant build to execute various code generation tasks (anyone have fond memories of ejbgen like I do? ;) )

I was able to get Eclipse set up to be happy with the relatively complex build structure, and happily discovered the “Ant Builder” capability of Eclipse, which allows ant build tasks to be inserted into the Eclipse build process. Tying this external build process into the IDE helped improve my efficiency while working on this complex project. I’ll go over here briefly how you can use this feature through an illustrative example.
Continue reading “Quick Tip: Using “Ant Builder” to customize Eclipse builds using ant scripts”