I had this problem because my srcdir was installed in the package folder that contained java files.
Changing this in the top-level source folder was better, but then the schematic wanted to make a scheme for all .java files in my source path (only 20% were actually jaxb classes).
My last call to ant is as follows:
<property name="event.package" value="my/organisation/events"/> <schemagen srcdir="${src.main.java.dir}" destdir="META-INF/event-schema" classpathref="build.classpath"> <include name="${event.package}/Event1.java"/> <include name="${event.package}/Event2.java"/> </schemagen>
source share