I have been grappling with finding an answer to this for hours...on the surface it doesn't seem to work but maybe I'm doing it wrong. I have a jar file containing nothing but a directory structure full of various XSD files. I want to be able to use either the XJC.exe (with sun/oracle java 6) or the XJC Ant task to target and compile certain schemas out of this jar file without having to extract them. According to the documentation you are supposed to be able to supply an XSD file name or a URL or a directory containing one or more schemas or a jar file as the input to XJC. So far I can only get it to work when I extract the jar file contents and specify a specific XSD file or directory. That is not desirable. I have tried something like this (assuming the jar file is name 'myjarfile.jar'):
I get an error saying something like "no grammar was specified"
This just doesn't work as it appears not to be able to locate the schema this way. I have verified the path and jar file directory structures and I'm almost sure I didn't make a mistake in the path reference. Am I trying to do something that just wasn't meant to be here or am I just screwing it up somehow?
EDIT: I notice also it says that if you specify a jar file that /META-INF/sun-jaxb.episode will be compiled...however the jar file contains no such file and I cannot put one there since I am not allowed to modify the jar file contents. So am I out of luck...must this file be present to give a jar file of schemas to XJC or is it optional?
Joined: Oct 26, 2010
Tried this again on a different computer and the method using: