Minimum working repro for 'build.xml': ``` <project><augment></augment><target name="init"></target></project> ``` $ ant Buildfile: /path/to/build.xml BUILD FAILED /path/to/build.xml:1: java.lang.IllegalStateException: augment attribute 'id' unset at org.apache.tools.ant.taskdefs.AugmentReference.hijackId(AugmentReference.java:66) at org.apache.tools.ant.taskdefs.AugmentReference.getProxy(AugmentReference.java:45) at org.apache.tools.ant.RuntimeConfigurable.maybeConfigure(RuntimeConfigurable.java:494) at org.apache.tools.ant.RuntimeConfigurable.maybeConfigure(RuntimeConfigurable.java:464) at org.apache.tools.ant.Task.maybeConfigure(Task.java:202) at org.apache.tools.ant.UnknownElement.configure(UnknownElement.java:200) at org.apache.tools.ant.UnknownElement.maybeConfigure(UnknownElement.java:164) at org.apache.tools.ant.Task.perform(Task.java:347) at org.apache.tools.ant.Target.execute(Target.java:435) at org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:180) at org.apache.tools.ant.ProjectHelper.configureProject(ProjectHelper.java:93) at org.apache.tools.ant.Main.runBuild(Main.java:832) at org.apache.tools.ant.Main.startAnt(Main.java:236) at org.apache.tools.ant.launch.Launcher.run(Launcher.java:287) at org.apache.tools.ant.launch.Launcher.main(Launcher.java:113)
As per the manual of this task[1] "id" is a mandatory attribute that you need to set. The build.xml sample, you posted doesn't have that attribute and hence that error. [1] https://ant.apache.org/manual/Tasks/augment.html
(In reply to Jaikiran Pai from comment #1) > As per the manual of this task[1] "id" is a mandatory attribute that you > need to set. The build.xml sample, you posted doesn't have that attribute > and hence that error. > > [1] https://ant.apache.org/manual/Tasks/augment.html @Jaikiran Pai: There is a difference between a build error that is reported with a simple message and an IllegalStateException being thrown by the core. Specifically, the core method org.apache.tools.ant.ProjectHelper.parse() should throw a BuildException when presented with such a build.xml file as referenced in the manual. However, an unchecked IllegalStateException is thrown instead. This makes programmatic use of the Ant core API difficult.
I see. I misunderstood the original report. You are right, unlike as stated in the manual, this currently isn't throwing a BuildException and indeed appears to be a bug.
(In reply to Jaikiran Pai from comment #3) > I see. I misunderstood the original report. You are right, unlike as stated > in the manual, this currently isn't throwing a BuildException and indeed > appears to be a bug. Thanks for the quick response and confirmation!
This has now been fixed in master and 1.9.x branches of Ant. The task will now throw a BuildException as stated in its manual. This will be available 1.10.6 and 1.9.14 releases (whenever they happen).