title: Can a maven artifact contain both a jar and an aar?
body: <p>I have a library in the Maven Central Repository.  For the latest release I have pushed an .aar archive in addition to the normal .jar.</p>
  
  <p>However I can't seem to get Android Studio to use the aar version of the library.  In my build.gradle file I have:</p>
  
  <pre><code>dependencies {
      compile 'com.android.support:appcompat-v7:19.+'
      compile 'com.mygroup:mylibrary:1.2.2'
  }
  </code></pre>
  
  <p>This successfully fetched the jar file, but how do I get it to use the aar version of the library?  I tried a number of things, including (but not limited to):</p>
  
  <pre><code>compile 'com.mygroup:mylibrary:1.2.2@aar'
  compile group: 'com.mygroup', name: 'mylibrary', version: '1.2.2', type: 'aar'
  compile group: 'com.mygroup', name: 'mylibrary', version: '1.2.2', packaging: 'aar'
  compile group: 'com.mygroup', name: 'mylibrary', version: '1.2.2', extension: 'aar'
  </code></pre>
  
  <p>But it always loads the jar.</p>
  
  <p>Is Gradle expecting the artifact to contain just the AAR only (with a POM that matches)?  Do I need to create a separate artifact for the AAR version of the lib?</p>