Maven jaxb2 plugin in Gradle
<p>I need to migrate a maven project to gradle. The maven project uses the <code>maven-jaxb2-plugin</code> like this (version for the plugin is set in a root <code>pom.xml</code>):</p>

<pre><code>&lt;plugin&gt;
  &lt;groupId&gt;...&lt;/groupId&gt;
  &lt;artifactId&gt;maven-jaxb2-plugin&lt;/artifactId&gt;
  &lt;executions&gt;
    &lt;execution&gt;
      &lt;goals&gt;
        &lt;goal&gt;generate&lt;/goal&gt;
      &lt;/goals&gt;
    &lt;/execution&gt;
  &lt;/executions&gt;
  &lt;configuration&gt;
    &lt;generatePackage&gt;package for generated classes&lt;/generatePackage&gt;
    &lt;schemaDirectory&gt;directory containing XSD files&lt;/schemaDirectory&gt;
    &lt;includeSchemas&gt;
        &lt;includeSchema&gt;XSD file name&lt;/includeSchema&gt;
        &lt;includeSchema&gt;XSD file name&lt;/includeSchema&gt;
        ...
    &lt;/includeSchemas&gt;
    &lt;strict&gt;true&lt;/strict&gt;
    &lt;verbose&gt;true&lt;/verbose&gt;
    &lt;extension&gt;true&lt;/extension&gt;
  &lt;/configuration&gt;
&lt;plugin&gt;
</code></pre>

<p>So, I wanted to achieve the same functionality in gradle, and this is what I have:</p>

<pre><code>plugins {
  id "com.github.jacobono.jaxb" version "1.3.5"
}
dependencies {
  jaxb "org.glassfish.jaxb:jaxb-runtime:2.2.11"
  jaxb "org.glassfish.jaxb:jaxb-xjc:2.2.11"
}
jaxb {
  xsdDir = "directory containing XSD files"
  xjc {
    taskClassname = "com.sun.tools.xjc.XJC2Task"
    generatedPackage = "package for generated classes"
  }
}
compileJava.dependsOn xjc
</code></pre>

<p>This project is part of a multi-project build with dependencies on other projects etc., but I don't think those are relevant.</p>

<p>Am I on the right track?? I'm asking because the behavior doesn't seem to be the same when I do <code>mvn clean install</code> and <code>gradle clean build</code></p>

<p>Question:  </p>

<ul>
<li>Is there a way to specify the XSD file names we want to use in gradle (as we do using <code>includeSchema</code> in maven)?</li>
</ul>

<p>My problem:</p>