title: How can I process multiple xsd schemas using jaxb and the Ant xjc task?
body: <p>I'm using jaxb to generate java object class from xml schemas within an Ant script like so:</p>
  
  <pre><code>&lt;!-- JAXB compiler task definition --&gt;
  &lt;taskdef name="xjc" classname="com.sun.tools.xjc.XJCTask"
                      classpathref="master-classpath"/&gt;
  
  &lt;!-- Generates the source code from the ff.xsd schema using jaxb --&gt;
  &lt;target name="option-generate" description="Generates the source code"&gt;
      &lt;mkdir dir="${generated-src.dir}/${option.dir}"/&gt;
      &lt;xjc schema="${config.dir}/ff.xsd" destdir="${generated-src.dir}"
           package="${option.package.name}"&gt;
          &lt;arg value="-Xcommons-lang" /&gt;
          &lt;arg value="-Xcommons-lang:ToStringStyle=SHORT_PREFIX_STYLE" /&gt;
          &lt;produces dir="${generated-src.dir}" includes="**/*.java" /&gt;
      &lt;/xjc&gt;
  &lt;/target&gt;
  </code></pre>
  
  <p>Now, this works brilliantly for one schema (ff.xsd in this example). How can I process several schemas (i.e. several xsd files)?</p>
  
  <p>I tried having a separate ant task per schema, but somehow, this doesn't work as Ant process the first task and then says that the "files are up to date" for the following schemas!</p>