title: How can I tell maven/wsimport to ignore certain schema files when generating code?
body: <p>I have several web services I need to integrate with, and I can do this by building web service clients using the wsimport plugin for Maven. The web services in question all reference enterprise-common schema files, so generating a separate client results in duplicate code, where each web service client jar contains an implementation of the same schema.</p>
  
  <p>I wanted to reduce this redundant code, so my first thought was to build a stand-alone jar <em>just</em> with the common code generated from the common schema. The problem here is that when I use maven to generate a web service client from a WSDL, it <em>will still</em> build code for all schemas references by the WSDL - how do I tell maven to <em>not</em> generate code for the common schema files, because the code is already in a referenced library?</p>
  
  <p>I did try this:</p>
  
  <pre><code>&lt;resources&gt;
      &lt;resource&gt;
          &lt;directory&gt;${basedir}/wsdl&lt;/directory&gt;
          &lt;excludes&gt;
              &lt;exclude&gt;**/my_schema.xsd&lt;/exclude&gt;
          &lt;/excludes&gt;
      &lt;/resource&gt;
  &lt;/resources&gt;
  </code></pre>
  
  <p>But wsimport still generates code for <code>my_schema.xsd</code> even though I created a dependency for the jar that already contains this code:</p>
  
  <pre><code>&lt;dependencies&gt;
      &lt;dependency&gt;
          &lt;artifactId&gt;MyCommonCode&lt;/artifactId&gt;
          &lt;groupId&gt;com.myCompany&lt;/groupId&gt;
          &lt;version&gt;1.0.0&lt;/version&gt;
      &lt;/dependency&gt;
  &lt;/dependencies&gt;
  </code></pre>