Ant for Automator

Ant is a well known tool to build java applications. I use it for any Java project.

The task of deployment does not end with building a software. In my case I have to send an email with the new build to the provider with informations about new features and instructions on how to update. Also most of my Java projects depend on other Java projects so I have to build them in the right order.

Therefore the workflow to release a new version of the software looks like this:

  1. Build the project with common classes and utilities
  2. Build the main project
  3. Open Finder and navigate to built file
  4. Drag the file to the Mail icon in the Dock
  5. Write and send the mail

A lot of times I forgot to do the first step or missed to add some information to the mail (e.g. on which environment (test, production) shall the release be deployed).

To avoid these errors in the future I use Automator. A simple Cocoa Automator Action provides the integration of Ant into Automator.

The Run Ant Script Action takes a number of Ant build files and executes them. You can specify the Ant target to execute, an additional classpath and the Java version that shall be used to run Ant. The output of the Automator Action are the generated files of any jar, war, ear, tar and zip commands in the Ant build file. Apple Developer tools must be installed as the Ant installation from there is used.


The Run Ant Script Action source code is released under MIT License.

2 Responses to “Ant for Automator”

  1. Graham Says:

    Wouldn’t it be better to set the ant path as /usr/bin/ant? With the Dev tools installed that is a symlink to /Developer/Java/Ant/bin/ant and for someone who had installed ant from source the action would also work. Even better would be to use the return value of ‘which ant’, but I know it’s obnoxious to make command line calls from within a program.

    Cheers for the Action.

  2. martin Says:

    You are absolutely right. Especially now that Leopard is out and Apple does no longer ship Ant with the Developer tools.
    So if you run Leopard please download the source code and adopt the ant path in the code.