users@jaxb.java.net

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

From: KARR, DAVID (ATTSI) <"KARR,>
Date: Tue, 22 Mar 2011 15:46:17 -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.
>
> 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.

A couple other points:

I tried removing the "include" element entirely, and it didn't change
the result.

Note that besides this problem, there aren't any problems with any of
the classes in the "domain" package. All of them are marshalling to XML
perfectly fine.