Consuming an aar /2

7 views
Skip to first unread message

Philippe Riand

unread,
Apr 3, 2017, 12:08:45 PM4/3/17
to Maven Android Developers
Not sure if the questions are monitored and must be accepted before showing, but looks like the one I posted this morning is not there. So I'm reposting it:-)

So I added the following dependency to my project:
<dependency>
   
<groupId>com.ibm.mobilefirstplatform.clientsdk.android</groupId>
   
<artifactId>push</artifactId>
   
<type>aar</type>
   
<version>3.4.1</version>
</dependency>

The library is an aar, so it cannot find it without the type explicitly specified. Now, the library itself has other aar dependencies but its pom.xml is missing the type:
    <dependency>
     
<groupId>com.android.support</groupId>
     
<artifactId>appcompat-v7</artifactId>
     
<version>23.1.1</version>
     
<scope>compile</scope>
   
</dependency>
   
<dependency>
     
<groupId>com.google.firebase</groupId>
     
<artifactId>firebase-messaging</artifactId>
     
<version>9.0.1</version>
     
<scope>compile</scope>
   
</dependency>

It works perfectly well with the Android studio as gradle automatically picks them up as aar. But the Maven plugin fails as it looks for jar file:
The following artifacts could not be resolved: com.android.support:appcompat-v7:jar:23.1.1, com.google.firebase:firebase-messaging:jar:9.0.1

Any idea on how this can be fixed without adding the <type> in the the pom.xml of the library?
I tried it in local .me. It worked, but I'm not controlling this as this is an IBM asset.
Seems to be a pretty common case when consuming external libraries
Reply all
Reply to author
Forward
0 new messages