Ant Problem - XJCTask Extension Attribute
843834Jun 14 2003 — edited Nov 11 2005Hi
I am using JAXB to compile an xsd file that uses substitution groups. The problem "goes away" when compiling from the command line using the jxc -extension option.
Using XJCTask with the extension attribute - see the following snippit:
<taskdef name="xjc" classname="com.sun.tools.xjc.XJCTask">
<classpath refid="classpath"/>
</taskdef>
<target name="xjc" description="Compiles the FpML schema." >
<echo message="Compiling the FpML schema into Java."/>
<!-- set extension to ignore substitution groups -->
<xjc extension="true"/>
<mkdir dir="classes"/>
<xjc target="classes">
<schema dir="xml" includes="*.xsd"/>
<binding dir="." includes="fpml.xjb"/>
<produces dir="." includes="classes/org/fpml/*.java"/>
</xjc>
</target>
Gives an error:
C:\jwsdp-1.2\jaxb\samples\FpML>ant xjc
Buildfile: build.xml
xjc:
[echo] Compiling the FpML schema into Java.
BUILD FAILED
file:C:/jwsdp-1.2/jaxb/samples/FpML/build.xml:101: grammar is not specified
Thanks for any help.
Tom Burns