I know this is old, but it can still help someone who is looking for an answer like me. If it does not work, change
<contains text="warnings"/>
to the text that you see with your output.
<target name="javadoc"> <delete dir="${jDocDirectory}"/> <mkdir dir="${jDocDirectory}"/> <record name="javadocLog" action="start"/> <javadoc (settings, blah blah) /> <record name="javadocLog" action="stop"/> <condition property="javadoc.warnings"> <isfileselected file="javadocLog"> <contains text="warnings"/> </isfileselected> </condition> <fail if="javadoc.warnings">Javadoc warnings!</fail> </target>
edit: If you have one warning, this will not work to fix ALL warnings, you should change this:
<contains text="warnings"/>
source share