3

I am trying to generate .java files from XSD files using JAXB. I have two xsd schemas, Base.xsd and Area.xsd. Area.xsd imports Base.xsd. I have been able to create java files for each of the schemas separately, but that results in duplicate java files for the Base.xsd. I tried to solve this problem by creating an episode file for Base.xsd using the command:

xjc -d out -episode base.episode Base.xsd

This worked fine and created the episode file as expected. Next I attempted to create the java files from each of the schemas:

xjc -d ...\src\main\java Base.xsd -p mypackage.base 
xjc -d ...\src\main\java Area.xsd -p mypackage.area -extension -b base.episode

The java files for Base.xsd were created successfully, however no files were created for Area.xsd (including the Area-specific classes). I have spent a lot of time looking into this issue, and it seems like it should work as expected.

Is this anything noticeably wrong with what I am doing? Please advise me if there is anything you would recommend changing.

Thanks in advance.

knr7201
  • 89
  • 4
  • I go through a full example of JAXB episode files in the following answer to a similar question: http://stackoverflow.com/questions/9756185/what-is-an-episode-file/9757472#9757472 – bdoughan Jun 27 '14 at 18:45
  • I saw that earlier when I was trying to debug my issue and followed it exactly. I'm still getting the same result with no java files generated for Area.xsd – knr7201 Jun 28 '14 at 02:41

0 Answers0