title: Excluding BuildConfig.class and R.class from Android library jar in Maven
body: <p>I'm using the Maven Android plugin to build my Android library using the <code>apklib</code> packaging. This produces an <code>apklib</code> archive of the library, so I'm also using the Maven jar plugin to produce a jar artifact that can be used in an app.</p>
  
  <p>My problem is that <code>BuildConfig.class</code> and <code>R.class</code> are being included in the jar, which I don't want (really I would like to exclude anything in <code>gen</code> altogether). I've been trying to create <code>exclude</code> rules for them but haven't had any success. Here's the jar plugin configuration I've been using in my pom:</p>
  
  <pre><code>&lt;plugin&gt;
      &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
      &lt;artifactId&gt;maven-jar-plugin&lt;/artifactId&gt;
      &lt;executions&gt;
          &lt;execution&gt;
              &lt;phase&gt;package&lt;/phase&gt;
              &lt;goals&gt;
                  &lt;goal&gt;jar&lt;/goal&gt;
              &lt;/goals&gt;
              &lt;configuration&gt;              
                  &lt;excludes&gt;
                      &lt;exclude&gt;**/BuildConfig.java&lt;/exclude&gt;
                      &lt;exclude&gt;**/R.java&lt;/exclude&gt;
                  &lt;/excludes&gt;
              &lt;/configuration&gt;
          &lt;/execution&gt;
      &lt;/executions&gt;
  &lt;/plugin&gt;
  </code></pre>
  
  <p>Any help is appreciated.</p>