Bad maven scope declaration for AAR dependency

263 views
Skip to first unread message

Tomáš Procházka

unread,
Aug 5, 2014, 4:23:36 PM8/5/14
to adt...@googlegroups.com
I have one gradle related question.

This project 
has one aar module  that depend on another one and on app compat library.
But during deploying to the maven repository, gradle don't generate <scope>aar</scope> to the dependency declaration.
So by maven definition it mean that dependency should be .jar not .aar.
It is bug of gradle itself or bug in your android plugin which define aar?

Problem is described also here:
https://github.com/ManuelPeinado/FadingActionBar/issues/70

Tomáš Procházka

unread,
Aug 5, 2014, 4:32:11 PM8/5/14
to adt...@googlegroups.com
Sorry. I don't mean <scope> but <type>

Dne úterý, 5. srpna 2014 22:23:36 UTC+2 Tomáš Procházka napsal(a):

Jake Wharton

unread,
Aug 5, 2014, 4:33:42 PM8/5/14
to adt...@googlegroups.com
Type isn't needed. The pom for ABC is queried and the declared packaging (aar) will be used.


--
You received this message because you are subscribed to the Google Groups "adt-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adt-dev+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Tomáš Procházka

unread,
Aug 6, 2014, 3:06:27 AM8/6/14
to adt...@googlegroups.com
Are you sure? Because when I use it in the maven base project I get

[ERROR] Failed to execute goal on project app-telekomTv: Could not resolve dependencies for project ...:apk:1.0.2-SNAPSHOT: The following artifacts could not be resolved: com.
github.manuelpeinado.fadingactionbar:fadingactionbar:jar:3.1.2, com.android.support:appcompat-v7:jar:21.0.0-rc1: Failure to find com.github.manuelpeinado.fadingactionbar:fadingactionbar:jar:3.1.2 in h
ttps://... was cached in the local repository, resolution will not be reattempted until the update interval of nexus has elapsed or updates are forced -> [Help 1]


Dne úterý, 5. srpna 2014 22:33:42 UTC+2 Jake Wharton napsal(a):

Vyacheslav Blinov

unread,
Aug 6, 2014, 10:07:36 AM8/6/14
to adt...@googlegroups.com

You are referring to Gradle behaviour here. But according to maven rules you should have type in your dependency declaration in pom (and pom is maven specific file). Maybe there are more build/dependency management systems that rely on type of dependency, but afaik at least maven users are, unfortunately, in trouble here and have to use exclusions hack.
I would say it is a bug in pom generation since pom-specific rules werent preserved.

06 авг. 2014 г. 0:33 пользователь "Jake Wharton" <jakew...@gmail.com> написал:

William Ferguson

unread,
Aug 7, 2014, 7:20:51 AM8/7/14
to adt...@googlegroups.com
This is bad. Similar to Gradle versions of "+" being copied into Maven poms.
If it is a Gradle Android plugin doing this then the plugin needs to be fixed.

Maven repos like Central should reject artifacts that provide malformed poms. To date they have relied upon everyone being good citizens but it seems like stricted enforcement is now required.

William

Tomáš Procházka

unread,
Aug 7, 2014, 8:23:45 AM8/7/14
to adt...@googlegroups.com
2014-08-07 13:20 GMT+02:00 William Ferguson <william....@xandar.com.au>:
This is bad. Similar to Gradle versions of "+" being copied into Maven poms.
If it is a Gradle Android plugin doing this then the plugin needs to be fixed.


 So you think that this is issue of Gradle Android plugin not gradle itself?
 
Maven repos like Central should reject artifacts that provide malformed poms. To date they have relied upon everyone being good citizens but it seems like stricted enforcement is now required.

I completely agree!
 

Jake Wharton

unread,
Aug 7, 2014, 11:51:41 AM8/7/14
to adt...@googlegroups.com
On Thu, Aug 7, 2014 at 5:23 AM, Tomáš Procházka <tomas.p...@atomsoft.cz> wrote:

2014-08-07 13:20 GMT+02:00 William Ferguson <william....@xandar.com.au>:

This is bad. Similar to Gradle versions of "+" being copied into Maven poms.
If it is a Gradle Android plugin doing this then the plugin needs to be fixed.

 So you think that this is issue of Gradle Android plugin not gradle itself?

It isn't. I can do this in any Gradle project, Android or not. This is user education issue that is not at all specific to Android.
 

Xavier Ducrohet

unread,
Aug 7, 2014, 3:15:01 PM8/7/14
to adt...@googlegroups.com
Someone reported this to me a few weeks ago already, but I didn't have time to look into it.

I just email the Gradle dev list asking for their opinion on this, since it's Gradle itself that's generating the POM (our plugin doesn't do anything).


--
You received this message because you are subscribed to the Google Groups "adt-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adt-dev+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Xavier Ducrohet
Android SDK Tech Lead
Google Inc.
http://developer.android.com | http://tools.android.com

Please do not send me questions directly. Thanks!

William Ferguson

unread,
Aug 7, 2014, 3:58:49 PM8/7/14
to adt...@googlegroups.com
Great, thanks for the follow up Xavier.


--
You received this message because you are subscribed to a topic in the Google Groups "adt-dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/adt-dev/PM50ZXFXN_k/unsubscribe.
To unsubscribe from this group and all its topics, send an email to adt-dev+u...@googlegroups.com.

Xavier Ducrohet

unread,
Aug 7, 2014, 7:24:22 PM8/7/14
to adt...@googlegroups.com
BTW, here the bug that was filed a while ago for this: https://code.google.com/p/android/issues/detail?id=72807

I'll update the bug when I have more information.

William Ferguson

unread,
Aug 7, 2014, 8:03:54 PM8/7/14
to adt...@googlegroups.com
It doesn't sound like a user education issue. 

It sounds like the Gradle Maven plugin that is generating the Maven pom is not doing what it should. Any idea where I can report an issue for it?


--
You received this message because you are subscribed to a topic in the Google Groups "adt-dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/adt-dev/PM50ZXFXN_k/unsubscribe.
To unsubscribe from this group and all its topics, send an email to adt-dev+u...@googlegroups.com.

Tomáš Procházka

unread,
Aug 8, 2014, 2:48:52 AM8/8/14
to adt...@googlegroups.com
Thanks. I also think that it will be bug in Gradle itself, but android plugin should be responsive for define "aar" type itself and Gradle should ask for it during deploy.

--
Ing. Tomáš Procházka


--
You received this message because you are subscribed to a topic in the Google Groups "adt-dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/adt-dev/PM50ZXFXN_k/unsubscribe.
To unsubscribe from this group and all its topics, send an email to adt-dev+u...@googlegroups.com.

Tomáš Procházka

unread,
Sep 5, 2014, 1:21:19 PM9/5/14
to adt...@googlegroups.com
It looks that nobody reply on it :-(

Gradle doesn't have some issue tracking tool?



Dne čtvrtek, 7. srpna 2014 21:15:01 UTC+2 Xavier Ducrohet napsal(a):

Luke Daley

unread,
Sep 7, 2014, 7:42:09 PM9/7/14
to adt...@googlegroups.com, Tomáš Procházka


On 6 September 2014 at 3:21:21 am, Tomáš Procházka (tomas.p...@gmail.com) wrote:

Tomáš Procházka

unread,
Nov 25, 2014, 5:30:16 PM11/25/14
to adt...@googlegroups.com
Any progress in this issue?

Here was suggested #6 solution for this problem with current version of the Gradle, so it is not neccesary to wait for Gradle team which ignore all bug reports :-(


Dne pátek, 8. srpna 2014 1:24:22 UTC+2 Xavier Ducrohet napsal(a):

David Carver

unread,
Jan 12, 2015, 3:54:08 PM1/12/15
to adt...@googlegroups.com
Actually this is Gradle violating Maven standards.  The packaging type in maven only applies to that artifact, not any dependencies.  If a type is not specified on a dependency in a pom, maven assumes that it is JAR.   Gradle is breaking compatibility with other tooling in this particular case.

More info here:


Particularly in the examples.  If type is not specified, maven assumes jar.
Reply all
Reply to author
Forward
0 new messages