We have a project that uses RESQML. We download the data schema v1.1 and need to run jaxb/xjc to generate some code. This command with the JDK's (1.6.0) xjc tool works
"%JAVA_HOME%\bin\xjc.exe" -verbose -b RESQML_data_schema_v1.1/bindings -extension -d build/generated RESQML_data_schema_v1.1/resqml_v1.1.0_data/xsd_schemas
But the following ant task with both JAXB 2.0 and 2.1.10 fail.
<jaxb:xjc destdir="${env.BUILD_DIR}/generated" extension="true">
<jaxb:binding dir="${basedir}/RESQML_data_schema_v1.1/bindings" includes="*.xjd"/>
<jaxb:schema dir="${basedir}/RESQML_data_schema_v1.1/resqml_v1.1.0_data/xsd_schemas" includes="*.xsd"/>
</jaxb:xjc>
It fails with these errors. Is there some extra option on the ant task I need to enable?
module.jaxb:
Consider using <depends>/<produces> so that XJC won't do unnecessary compilation
Compiling file:/C:/SVN/DS_5000_8_2_0/plugins/com.lgc.resqml/RESQML_data_schema_v1.1/resqml_v1.1.0_data/xsd_schemas/attgrp_objectUid.xsd and others
[ERROR] A class/interface with the same name "net.opengis.gml._3.SecondDefiningParameter" is already in use. Use a class customization to resolve this conflict.
line 1094 of file:/C:/SVN/DS_5000_8_2_0/plugins/com.lgc.resqml/RESQML_data_schema_v1.1/gml_resqml_v1.0_profile/gml/3.2.1/gml.xsd
[ERROR] (Relevant to above error) another "SecondDefiningParameter" is generated from here.
line 1107 of file:/C:/SVN/DS_5000_8_2_0/plugins/com.lgc.resqml/RESQML_data_schema_v1.1/gml_resqml_v1.0_profile/gml/3.2.1/gml.xsd
[ERROR] Two declarations cause a collision in the ObjectFactory class.
line 1107 of file:/C:/SVN/DS_5000_8_2_0/plugins/com.lgc.resqml/RESQML_data_schema_v1.1/gml_resqml_v1.0_profile/gml/3.2.1/gml.xsd
[ERROR] (Related to above error) This is the other declaration.
line 1094 of file:/C:/SVN/DS_5000_8_2_0/plugins/com.lgc.resqml/RESQML_data_schema_v1.1/gml_resqml_v1.0_profile/gml/3.2.1/gml.xsd
[ERROR] Two declarations cause a collision in the ObjectFactory class.
line 726 of file:/C:/SVN/DS_5000_8_2_0/plugins/com.lgc.resqml/RESQML_data_schema_v1.1/gml_resqml_v1.0_profile/gml/3.2.1/gml.xsd
[ERROR] (Related to above error) This is the other declaration.
line 709 of file:/C:/SVN/DS_5000_8_2_0/plugins/com.lgc.resqml/RESQML_data_schema_v1.1/gml_resqml_v1.0_profile/gml/3.2.1/gml.xsd
[ERROR] Two declarations cause a collision in the ObjectFactory class.
line 906 of file:/C:/SVN/DS_5000_8_2_0/plugins/com.lgc.resqml/RESQML_data_schema_v1.1/gml_resqml_v1.0_profile/gml/3.2.1/gml.xsd
[ERROR] (Related to above error) This is the other declaration.
line 923 of file:/C:/SVN/DS_5000_8_2_0/plugins/com.lgc.resqml/RESQML_data_schema_v1.1/gml_resqml_v1.0_profile/gml/3.2.1/gml.xsd
[ERROR] Two declarations cause a collision in the ObjectFactory class.
line 1183 of file:/C:/SVN/DS_5000_8_2_0/plugins/com.lgc.resqml/RESQML_data_schema_v1.1/gml_resqml_v1.0_profile/gml/3.2.1/gml.xsd
[ERROR] (Related to above error) This is the other declaration.
line 1166 of file:/C:/SVN/DS_5000_8_2_0/plugins/com.lgc.resqml/RESQML_data_schema_v1.1/gml_resqml_v1.0_profile/gml/3.2.1/gml.xsd
[ERROR] Two declarations cause a collision in the ObjectFactory class.
line 877 of file:/C:/SVN/DS_5000_8_2_0/plugins/com.lgc.resqml/RESQML_data_schema_v1.1/gml_resqml_v1.0_profile/gml/3.2.1/gml.xsd
[ERROR] (Related to above error) This is the other declaration.
line 894 of file:/C:/SVN/DS_5000_8_2_0/plugins/com.lgc.resqml/RESQML_data_schema_v1.1/gml_resqml_v1.0_profile/gml/3.2.1/gml.xsd
[ERROR] Two declarations cause a collision in the ObjectFactory class.
line 1195 of file:/C:/SVN/DS_5000_8_2_0/plugins/com.lgc.resqml/RESQML_data_schema_v1.1/gml_resqml_v1.0_profile/gml/3.2.1/gml.xsd
[ERROR] (Related to above error) This is the other declaration.
line 1212 of file:/C:/SVN/DS_5000_8_2_0/plugins/com.lgc.resqml/RESQML_data_schema_v1.1/gml_resqml_v1.0_profile/gml/3.2.1/gml.xsd
[ERROR] Two declarations cause a collision in the ObjectFactory class.
line 1055 of file:/C:/SVN/DS_5000_8_2_0/plugins/com.lgc.resqml/RESQML_data_schema_v1.1/gml_resqml_v1.0_profile/gml/3.2.1/gml.xsd
[ERROR] (Related to above error) This is the other declaration.
line 1071 of file:/C:/SVN/DS_5000_8_2_0/plugins/com.lgc.resqml/RESQML_data_schema_v1.1/gml_resqml_v1.0_profile/gml/3.2.1/gml.xsd
[ERROR] Two declarations cause a collision in the ObjectFactory class.
line 953 of file:/C:/SVN/DS_5000_8_2_0/plugins/com.lgc.resqml/RESQML_data_schema_v1.1/gml_resqml_v1.0_profile/gml/3.2.1/gml.xsd
[ERROR] (Related to above error) This is the other declaration.
line 935 of file:/C:/SVN/DS_5000_8_2_0/plugins/com.lgc.resqml/RESQML_data_schema_v1.1/gml_resqml_v1.0_profile/gml/3.2.1/gml.xsd
[ERROR] Two declarations cause a collision in the ObjectFactory class.
line 1016 of file:/C:/SVN/DS_5000_8_2_0/plugins/com.lgc.resqml/RESQML_data_schema_v1.1/gml_resqml_v1.0_profile/gml/3.2.1/gml.xsd
[ERROR] (Related to above error) This is the other declaration.
line 999 of file:/C:/SVN/DS_5000_8_2_0/plugins/com.lgc.resqml/RESQML_data_schema_v1.1/gml_resqml_v1.0_profile/gml/3.2.1/gml.xsd
failure in the XJC task. Use the Ant -verbose switch for more details
BUILD FAILED
C:\SVN\DS_5000_8_2_0\plugins\com.lgc.resqml\lgcbuild.xml:37: failed to compile a schema
----------------------------------------------------------------------
This e-mail, including any attached files, may contain confidential and privileged information for the sole use of the intended recipient. Any review, use, distribution, or disclosure by others is strictly prohibited. If you are not the intended recipient (or authorized to receive information for the intended recipient), please contact the sender by reply e-mail and delete all copies of this message.