title: Generate Serializable classes from a rest WADL with maven
body: <p>I need to generate classes that implement <code>Serializable</code> from a rest WADL using a maven plugin. I am able to do this with WSDL projects by adding a <code>jaxb-bindings.xml</code> but this is not working for WADL project. </p>
  
  <p><strong>Edit:</strong> 
  Now I am getting this error when generating the files</p>
  
  <blockquote>
    <p>Failed to execute goal
    org.apache.cxf:cxf-wadl2java-plugin:3.2.0:wadl2java (generate-sources)
    on project my_project: java.lang.RuntimeException: Error compiling
    schema from WADL :
    "<a href="http://localhost:8080/rest_web/rest/application.wadl" rel="nofollow noreferrer">http://localhost:8080/rest_web/rest/application.wadl</a>" is not a part
    of this compilation. Is this a mistake for
    "<a href="http://localhost:8080/rest_web/rest/application.wadl/xsd2.xsd" rel="nofollow noreferrer">http://localhost:8080/rest_web/rest/application.wadl/xsd2.xsd</a>"? ->
    [Help 1]</p>
  </blockquote>
  
  <ol>
  <li>I figured out that my  tag was in the wrong place on the
  client so i fixed it.</li>
  <li>I added the extraarg for -xjc-extension becuase of link to oracle
  documents from this <a href="https://issues.apache.org/jira/browse/CXF-7171" rel="nofollow noreferrer">CXF issue</a></li>
  <li>Updated my jaxb-bindings.xml</li>
  </ol>
  
  <p>web app pom.xml that generates the WADL:<br></p>
  
  <pre><code>&lt;plugin&gt;
      &lt;groupId&gt;com.sun.jersey.contribs&lt;/groupId&gt;
      &lt;artifactId&gt;maven-wadl-plugin&lt;/artifactId&gt;
      &lt;version&gt;1.19.4&lt;/version&gt;
      &lt;executions&gt;
          &lt;execution&gt;
              &lt;id&gt;generate&lt;/id&gt;
              &lt;goals&gt;
                  &lt;goal&gt;generate&lt;/goal&gt;
              &lt;/goals&gt;
              &lt;phase&gt;prepare-package&lt;/phase&gt;
          &lt;/execution&gt;
      &lt;/executions&gt;
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
              &lt;artifactId&gt;slf4j-simple&lt;/artifactId&gt;
              &lt;version&gt;1.7.25&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;xerces&lt;/groupId&gt;
              &lt;artifactId&gt;xercesImpl&lt;/artifactId&gt;
              &lt;version&gt;2.11.0&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.fasterxml.jackson.core&lt;/groupId&gt;
              &lt;artifactId&gt;jackson-core&lt;/artifactId&gt;
              &lt;version&gt;2.9.1&lt;/version&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
      &lt;configuration&gt;
          &lt;wadlFile&gt;${project.build.outputDirectory}/application.wadl&lt;/wadlFile&gt;
          &lt;formatWadlFile&gt;true&lt;/formatWadlFile&gt;
          &lt;baseUri&gt;http://${server}:8080/${project.name}/rest&lt;/baseUri&gt;
          &lt;packagesResourceConfig&gt;
              &lt;param&gt;webservice.rest&lt;/param&gt;
          &lt;/packagesResourceConfig&gt;
          &lt;wadlGenerators&gt;
              &lt;wadlGeneratorDescription&gt;
                  &lt;className&gt;com.sun.jersey.server.wadl.generators.WadlGeneratorApplicationDoc
                  &lt;/className&gt;
                  &lt;properties&gt;
                      &lt;property&gt;
                          &lt;name&gt;applicationDocsFile&lt;/name&gt;
                          &lt;value&gt;${basedir}/src/main/doc/application-doc.xml&lt;/value&gt;
                      &lt;/property&gt;
                  &lt;/properties&gt;
              &lt;/wadlGeneratorDescription&gt;
              &lt;wadlGeneratorDescription&gt;
                  &lt;className&gt;com.sun.jersey.server.wadl.generators.WadlGeneratorGrammarsSupport&lt;/className&gt;
                  &lt;properties&gt;
                      &lt;property&gt;
                          &lt;name&gt;grammarsFile&lt;/name&gt;
                          &lt;value&gt;${basedir}/src/main/doc/application-grammars.xml&lt;/value&gt;
                      &lt;/property&gt;
                  &lt;/properties&gt;
              &lt;/wadlGeneratorDescription&gt;
          &lt;/wadlGenerators&gt;
      &lt;/configuration&gt;
  &lt;/plugin&gt;
  </code></pre>
  
  <p>Client pom.xml file:</p>
  
  <pre><code>&lt;plugin&gt;
      &lt;groupId&gt;org.apache.cxf&lt;/groupId&gt;
      &lt;artifactId&gt;cxf-wadl2java-plugin&lt;/artifactId&gt;
      &lt;version&gt;3.2.0&lt;/version&gt;
      &lt;executions&gt;
          &lt;execution&gt;
              &lt;id&gt;generate-sources&lt;/id&gt;
              &lt;phase&gt;generate-sources&lt;/phase&gt;
              &lt;configuration&gt;
                  &lt;sourceRoot&gt;${basedir}/target/generated-sources&lt;/sourceRoot&gt;
                  &lt;wadlOptions&gt;
                      &lt;wadlOption&gt;
                          &lt;wadl&gt;http://localhost:8080/rest_web/rest/application.wadl&lt;/wadl&gt;
                          &lt;extraargs&gt;
                              &lt;extraarg&gt;-verbose&lt;/extraarg&gt;
                              &lt;extraarg&gt;-xjc-extension&lt;/extraarg&gt;
                          &lt;/extraargs&gt;
                          &lt;bindingFiles&gt;
                              &lt;bindingFile&gt;${basedir}/src/main/resources/META-INF/jaxb/jaxb-bindings.xml&lt;/bindingFile&gt;
                          &lt;/bindingFiles&gt;
                          &lt;packagename&gt;org.apache.cxf.systest.jaxrs.codegen.service&lt;/packagename&gt;
                          &lt;schemaPackagenames&gt;
                              &lt;schemaPackagename&gt;http://superbooks=org.apache.cxf.systest.jaxrs.codegen.schema&lt;/schemaPackagename&gt;
                          &lt;/schemaPackagenames&gt;
                      &lt;/wadlOption&gt;
                  &lt;/wadlOptions&gt;
              &lt;/configuration&gt;
              &lt;goals&gt;
                  &lt;goal&gt;wadl2java&lt;/goal&gt;
              &lt;/goals&gt;
          &lt;/execution&gt;
      &lt;/executions&gt;
  &lt;/plugin&gt;
  </code></pre>
  
  <p>jaxb-bindings.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;bindings xmlns="http://java.sun.com/xml/ns/jaxb"
            xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance"
            xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
            xsi:schemaLocation="http://java.sun.com/xml/ns/jaxb http://java.sun.com/xml/ns/jaxb/bindingschema_2_0.xsd"
            version="2.1"&gt;
      &lt;globalBindings&gt;
          &lt;serializable uid="1" /&gt;
      &lt;/globalBindings&gt;
  &lt;/bindings&gt; 
  </code></pre>