Ant Debugger

Compatible with:  IntelliJ IDEA Android Studio
15.02.2010
11 378
Ant Debugger enables Apache Ant build script debugging:
  • Open build file in editor
  • Set debug breakpoints (screenshot 1)
  • Right click on editor to show context menu (screenshot 2) and select the "Debug" menu item to launch Ant debugger
  • Wait until the Ant debugger stops on breakpoint then use step or resume debugger commands, investigate Ant variables and execution stack (screenshot 3)

You can add Ant debug configuration from the Edit configurations dialog (screenshot 4). Then you select Ant file, Java SDK for debugging session (screenshot 5).

Note. Plugin requires Java SDK to launch Ant: plugin uses build file module, project or any SDK for JDK list (the plugin searches for Java SDK in this order and uses first found).

Installation: use Idea plugins manager:

  • open Settings > plugins
  • wait until the plugin list loads
  • right click on Ant Debugger plugin and select install / update from the context menu
  • restart Idea

Supported Idea versions: Idea 8.1.x, Idea 9 (community and ultimate editions).

Please write to antdebugger at handyedit.com if there are errors / problems when using Ant debugger

Download plugin

Recent change notes

1.1.6

  • Run setting: logging level (default, quiet, verbose, debug).
  • Launch targets from context menu fix

1.1.5

  • Show pathes in Ant variables (also avaliable in the Evaluate dialog by Alt-F8). The variable name is path element ID.
  • Don't stop on property tasks when stepping only if the task is outside the current target

1.1.4

  • Breakpoints fix for tasks with multiline empty tag
  • Don't stop on patternset, path, tstamp tasks when stepping

1.1.3

  • Create configuration from context menu: 'make' is disabled
  • Don't stop on property, typedef, taskdef tasks when stepping
  • Breakpoints fix for tasks with multiline open tag

1.1.2

  • Step in / over / out support
  • Run to cursor fixes

1.1.1

  • Run configuration fix: create configuration

1.1

  • Variable value tooltip, expression evaluation (Alt-F8)
  • Run configuration: show targets from imported files
  • Run configuration fix: reload targets list on build file change

1.0.8

  • Set breakpoint fix for Windows
  • Run configuration fix: create configuration in project without JDK
  • Fix: determine that Ant process terminated on debugger connect

1.0.7

  • Run configuration: build target selection
  • Can debug target right clicking on it
  • Run configuration: VM parameters

1.0.6

  • Fix: projects with JDK 1.5
  • Fix: step into macro-def
  • Multiple files support fixes

1.0.5

  • Ant launch fix for Windows: quotes

1.0.4

  • Ant launch fix for Windows

1.0.3

  • Fix for Windows: removed Java path checking
  • Ant launch fix for Windows

1.0.2

  • Configuration: custom Ant tasks folder
  • Fix: don't block Ant build if Idea hasn't connected to it (timeout in build listener)
  • More feedback for connect error

1.0.1

  • Multiple XML files support
  • UI enhancements

Anonymous
15.10.2014
Two problems: 1. Adding a long "VM Parameters" string causes the text fields to disappear off to the right-hand side of the configuration pane. 2. There is no way to add multiple system properties. Using the "VM Parameters", it is possible to add one via a -D flag, but the runner places all of these parameters inside double quotes, so multiple flags do not work.
14.06.2011
Not sure how well this still works in IntelliJ IDEA 10.x. At least for me it's no longer stopping at any breakpoints in the ant script.
Anonymous
18.02.2011
Doesn't work for me. Ignores the Additional Classpath in the properties.
15.12.2009
This is still very young, but with a little work will be a fantastic plugin! An Ant debugger has been missing from IDEA for far too long. It's one of the few areas I've had to use NetBeans or Eclipse for.

The plugin works great on OS X, I've had some issues with XP, but the author has been very responsive in fixing bugs so far.

Kudos to Alexi for writing this!
12.12.2009
Expression evaluation doesn't work yet (Alt-F8)
It will be in next release
Anonymous
19.11.2009
Ant debugger 1.0.2:
http://handyedit.com/antdebugger/ant-debugger.jar
18.11.2009
Please download the 1.0.2 version when appears download link for it (needs approve of this site admin...)
There are more feedback about connection error in the new version: dialog boxes, and console with Ant command line is shown even if hasn't connected.

1. Does debug tool window appear and what's Ant command line in it (in console tab)? Maybe Ant build hasn't started due errors in it.

2. Does your build uses custom Ant tasks? You need to select the folder with JARs that contain your custom tasks (Ant debug configuration).

3. Maybe, the port for debugging is used. Use netstat to see if there is a process that uses Ant debug port (see port number in Ant debug configuration).

Please write email with your details to antdebugger at handyedit.com, and we'll try to find what's wrong.
Anonymous
18.11.2009
When trying to debug I get "Can't connect to Ant process". Thoughts as to how to resolve this?

16.11.2009
XML only now
Anonymous
16.11.2009
When debugging, is it just xml or will it allow you to GoTo the ant task java code?
Please  sign in  to leave a comment.