"ant javadoc" runs into errors for projects with a large number of source files or libraries because the command sent to the OS becomes too long.
Easy fix is adding useexternalfile="yes" into build.xml. Officially supported in ant 1.7.0, but works with 1.6.5 also.
Original mail from AppFuse-User Mailing List:
=======================================================================================
Hi all,
I just ran into errors using "ant javadoc" in appfuse 1.9.4.
As soon as you get enough source files or libs you run into a "java.io.IOException: CreateProcess ..."(mostly means binaries are not in the PATH). Took me some time to find this:
http://www.nabble.com/javadoc-task-tf2315.html#a7568 stating that the command line simply is too long (each appgen-run from pojo adds at least 300-500 chars depending on absolute source path) and pointing to the "useexternalfile" attribute usable from ant 1.7.0 on (see
http://ant.apache.org/manual/CoreTasks/javadoc.html ). Interestingly it already works with ant 1.6.5.
I changed my build.xml like shown in the snippet below (only inserted 'useexternalfile="yes"') and it works like a charm. It cut my command line from 33637 to 5302 characters :) .
I hope this information helps people who search nabble for javadoc errors in the future :-)
Maybe it's even worth updating the build.xml for 1.9.4 even with 2.0 so close?
Cheers,
Chris
---8<--- snip ---->8----
<target name="javadoc" depends="java2html"
description="Generate JavaDoc API docs">
<javadoc
destdir="${build.dir}/docs/api"
packagenames="com.garderos.acconfigserver.*"
author="true"
version="true"
windowtitle="${webapp.name} api"
doctitle="<h1>${webapp.name} javadocs for
version ${webapp.version}</h1>"
bottom="Copyright © 2002-${copyright.year}"
stylesheetfile="${build.dir}/docs/api/stylesheet.css"
useexternalfile="yes">
<fileset dir="${src}">
<patternset refid="java.files.pattern"/>
</fileset>
---8<--- snip ---->8----