title: Howto generate classes from WSDL and XSD with gradle, equivalent to maven-jaxb2-plugin
body: <p>I want to switch my Maven2 build file to gradle.
  Generating the java classes from WSDL + XSDs with gradle seems to be not documented further there is no gradle plugin for this.
  I use the following configuration with maven and search the equivalent for gradle.</p>
  
  <pre><code>&lt;!-- plugin for generating the classes from the WSDL+XSD --&gt;
  &lt;plugin&gt;
    &lt;groupId&gt;org.jvnet.jaxb2.maven2&lt;/groupId&gt;
    &lt;artifactId&gt;maven-jaxb2-plugin&lt;/artifactId&gt;
    &lt;version&gt;0.7.3&lt;/version&gt;
    &lt;executions&gt;
      &lt;execution&gt;
        &lt;id&gt;app1-stub-generation&lt;/id&gt;
        &lt;goals&gt;
          &lt;goal&gt;generate&lt;/goal&gt;
        &lt;/goals&gt;
        &lt;configuration&gt;
          &lt;schemaDirectory&gt;${project.build.directory}/wsdl/app1&lt;/schemaDirectory&gt;
          &lt;schemaIncludes&gt;
            &lt;include&gt;*.xsd&lt;/include&gt;
          &lt;/schemaIncludes&gt;
          &lt;generatePackage&gt;org.app1.ws.generated&lt;/generatePackage&gt;
          &lt;generateDirectory&gt;${project.build.directory}/generated-sources/app1&lt;/generateDirectory&gt;
          &lt;strict&gt;true&lt;/strict&gt;
        &lt;/configuration&gt;
      &lt;/execution&gt;
      &lt;execution&gt;
        &lt;id&gt;app2-v1-stub-generation&lt;/id&gt;
        &lt;goals&gt;
          &lt;goal&gt;generate&lt;/goal&gt;
        &lt;/goals&gt;
        &lt;configuration&gt;
          &lt;schemaDirectory&gt;src/main/resources/wsdl&lt;/schemaDirectory&gt;
          &lt;schemaIncludes&gt;
            &lt;include&gt;v1/*.xsd&lt;/include&gt;
          &lt;/schemaIncludes&gt;
          &lt;generatePackage&gt;org.app2.ws.generated.v1&lt;/generatePackage&gt;
          &lt;generateDirectory&gt;${project.build.directory}/generated-sources/v1&lt;/generateDirectory&gt;
          &lt;strict&gt;true&lt;/strict&gt;
        &lt;/configuration&gt;
      &lt;/execution&gt;
      &lt;execution&gt;
        &lt;id&gt;app2-v2-stub-generation&lt;/id&gt;
        &lt;goals&gt;
          &lt;goal&gt;generate&lt;/goal&gt;
        &lt;/goals&gt;
        &lt;configuration&gt;
          &lt;schemaDirectory&gt;src/main/resources/wsdl&lt;/schemaDirectory&gt;
          &lt;schemaIncludes&gt;
            &lt;include&gt;v2/*.xsd&lt;/include&gt;
          &lt;/schemaIncludes&gt;
          &lt;generatePackage&gt;org.app2.ws.generated.v2&lt;/generatePackage&gt;
          &lt;generateDirectory&gt;${project.build.directory}/generated-sources/v2&lt;/generateDirectory&gt;
          &lt;strict&gt;true&lt;/strict&gt;
        &lt;/configuration&gt;
      &lt;/execution&gt;
    &lt;/executions&gt;
  &lt;/plugin&gt; 
  </code></pre>