users@jaxb.java.net

RE: Why is schemagen seemingly ignoring most of my classes?

From: KARR, DAVID (ATTSI) <"KARR,>
Date: Tue, 22 Mar 2011 19:33:40 -0700

> -----Original Message-----
> From: KARR, DAVID (ATTSI)
> Sent: Tuesday, March 22, 2011 3:41 PM
> To: users_at_jaxb.java.net
> Subject: Why is schemagen seemingly ignoring most of my classes?
>
> I had a schemagen task that was working at some point in the recent
> past. I just tried it today and it appears to be only generating
types
> and elements from a single class in the package I told it to look in.
> I
> need it to only operate on a single package in my source tree, but I
> want it to process all the classes in that package.

Hmm, it just occurred to me do an "ant clean" before the build, and that
appears to fix it. Does schemagan not process the Java files that are
older than the existing schema file? That still wouldn't explain why it
does a single Java file, which is definitely older than the schema file.

> What I currently have is this:
>
> <target name="gen-schema" depends="init">
> <taskdef name="schemagen" classpathref="build.classpath"
> classname="com.sun.tools.jxc.SchemaGenTask"/>
> <schemagen srcdir="src/main/java"
> destdir="${main.classes.dir}">
> <include name="**/domain/*.java"/>
> <schema namespace="http://mynamespace"
> file="MySchema.xsd"/>
> </schemagen>
> </target>
>
> I have perhaps 20 Java source files in that package, but it's only
> creating types from a single one of those classes. I'm not sure what
> the distinguishing factor is about that one class, except for the fact
> that it's a base class of some of the other classes in the package.
> Every class has an "@XmlType" annotation on the class.