title: How do I unpack AAR dependency classes in Maven?
body: <p>I use Maven and I need to process classes from another dependencies. Before processing the classes, <code>maven-dependency-plugin</code> is used to unpack those dependencies with the <code>unpack-dependencies</code> goal, so then I can process the classes in the <code>target</code> directory. Everything is fine while the referenced dependencies are packaged as JARs. Now I'm faced with an AAR dependency that is required to be class-processed in a special way. The error I get so far is:</p>
  
  <pre><code>Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:2.10:unpack-dependencies (aars-only) on project app-android: Unknown archiver type: No such archiver: 'aar'. -&gt; [Help 1]
  </code></pre>
  
  <p>The <code>aars-only</code> execution identifier comes from the configuration below, but in general it gives the same error if not splitting the executions. Here is my <code>maven-dependency-plugin</code> configuration I have split later into two executions:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;plugin&gt;
      &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
      &lt;artifactId&gt;maven-dependency-plugin&lt;/artifactId&gt;
      &lt;executions&gt;
          &lt;execution&gt;
              &lt;id&gt;jars-only&lt;/id&gt;
              &lt;phase&gt;process-classes&lt;/phase&gt;
              &lt;goals&gt;
                  &lt;goal&gt;unpack-dependencies&lt;/goal&gt;
              &lt;/goals&gt;
              &lt;configuration&gt;
                  &lt;includeScope&gt;runtime&lt;/includeScope&gt;
                  &lt;includeGroupIds&gt;foo-group,bar-group&lt;/includeGroupIds&gt;
                  &lt;includeTypes&gt;jar&lt;/includeTypes&gt; &lt;!-- this is necessary to skip AAR dependencies --&gt;
                  &lt;outputDirectory&gt;${project.build.directory}/classes&lt;/outputDirectory&gt;
              &lt;/configuration&gt;
          &lt;/execution&gt;
          &lt;execution&gt;
              &lt;id&gt;aars-only&lt;/id&gt;
              &lt;phase&gt;process-classes&lt;/phase&gt;
              &lt;goals&gt;
                  &lt;goal&gt;unpack-dependencies&lt;/goal&gt;
              &lt;/goals&gt;
              &lt;configuration&gt;
                  &lt;includeScope&gt;runtime&lt;/includeScope&gt;
                  &lt;includeGroupIds&gt;baz-group&lt;/includeGroupIds&gt;
                  &lt;includeTypes&gt;aar&lt;/includeTypes&gt; &lt;!-- hoping this can process AARs as well, but it's just another execution, nothing special --&gt;
                  &lt;outputDirectory&gt;${project.build.directory}/classes&lt;/outputDirectory&gt;
              &lt;/configuration&gt;
          &lt;/execution&gt;
      &lt;/executions&gt;
  &lt;/plugin&gt;
  </code></pre>
  
  <p>Commenting out the <code>aars-only</code> execution leads to a runtime application crash, but the build passes as the <code>jars-only</code> execution includes the <code>jar</code> type only -- not exactly what I need.</p>
  
  <p>How do I unpack the AAR dependency (<code>baz-group</code>) to the <code>target/classes</code> directory? Is it possible to configure the <code>maven-dependency-plugin</code> somehow so it could accept AAR and its packed <code>classes.jar</code>? Or is there any other way to make it work probably just using another plugin?</p>
  
  <p>(Maybe it's a useful hint: I also use <code>com.simpligility.maven.plugins:android-maven-plugin</code>.)</p>