Because of various issues with the XSDs I need to compile (described in other SO posts), I have a bindings file and also a local extension schema. The following command line works correctly, but I'm having trouble figuring out the right pom.xml
configuration to mimic this:
xjc -nv src/main/resources/TCIP_4_0_0_Final.xsd src/main/resources/local/ObaCcLocationReport.xsd -b src/main/resources/local/rename.xjb -d target
Mainly, how do I specify more than one XSD? I tried:
<schemaDirectory>src/main/resources</schemaDirectory>
<schemaIncludes>
<include>TCIP_4_0_0_Final.xsd</include>
<include>local/ObaCcLocationReport.xsd</include>
</schemaIncludes>
but it seemed to ignore the second include
.
I also tried variations on:
<schema>
<fileset>
<directory>src/main/resources</directory>
<includes>
<include>TCIP_4_0_0_Final.xsd</include>
<include>local/ObaCcLocationReport.xsd</include>
</includes>
</fileset>
</schema>
without success. Suggestions?
EDIT
This works as a workaround, but it's not ideal:
Since ObaCcLocationReport.xsd
depends on schemas that get compiled as part of TCIP_4_0_0_Final.xsd
, I just had to make sure it got compiled after that, and it seems to process files in filepath order. So I put the ObaCcLocationReport.xsd
into an x
subfolder and changed the pom.xml
to:
<schemaDirectory>src/main/resources</schemaDirectory>
<schemaIncludes>
<include>TCIP_4_0_0_Final.xsd</include>
<include>x/ObaCcLocationReport.xsd</include>
</schemaIncludes>
This compiled the schemas and generated the Java files correctly.