There is a great deal of mystery surrounding the Netbeans/Glassfish/OpenESB build process. I'll include here a few details for others that may be interested, but it appears that a headless build is not possible or practical at this time. If you're looking for a solution, you won't find it here.
When I first started using Netbeans I was encouraged that it used ant for its builds rather than some process implemented as part of the IDE. However, in practice, doing a build outside the IDE turns out to be not only non-trivial but extremely complex, and may be impossible in some cases. For example, in the case of a BPEL project that includes a WSDL dragged into the BPEL editor from another project...
When a WSDL from a separate project is included in a BPEL, the tag's location cause looks like this:
<import namespace="http://myns" location="otherProject/my.wsdl" importType="http://schemas.xmlsoap.org/wsdl/"/>
where "otherProject" is the project containing the web service being used. WSDLs from the local BPEL project look like this:
<import namespace="http://myns" location="my.wsdl" importType="http://schemas.xmlsoap.org/wsdl/"/>
This location tag is not an operating system file path. "otherProject/" in the above example can be anyplace on the system relative to the project being built and the the IDE somehow finds it. Using "file://something" in the location tag is apparently a syntax error. It's hard to say what this location tag actually is. At the moment, I don't know.
Outside of the IDE, a location tag such as the above fails to find the WSDL file during the build. The failure occurs in at least two java classes that the build script invokes.
org.netbeans.modules.bpel.project.anttasks.cli.CliValidateBpelProjectTask
org.netbeans.modules.bpel.project.anttasks.cli.CliGenerateCatalogTask
Somehow these classes are able, in the IDE, to map the location tag to a physical WSDL file. The only reference I could find to these location strings is in the catalog.xml file in the project's base directory. But removing these does not create a build error in the IDE, so that can't be how it knows. Is there some internal database in Netbeans tracking these references? Hard to say.
A good deal of essential information on building Netbeans projects outside of the IDE can be found here:
http://blogs.sun.com/tronds/entry/creating_a_simple_headless_buildThis information is vital to getting started with the build environment, outside the IDE. That setup may be enough for most projects, or at least projects other than BPEL projects that refer to WSDLs in other projects.
GUI-only builds is a very surprising limitation, but there it is. It seems we will have to replace the build scripts for our projects. It would have been better to know about this a long time ago, before beginning projects using this otherwise really quite nice technology.