Dependency on AAR provided by project module

81 views
Skip to first unread message

Tomáš Procházka

unread,
Jan 19, 2015, 3:37:19 PM1/19/15
to maven-androi...@googlegroups.com
I found one very interesting bug in latest 4.1.0 version

I have project which contain two maven modules.
One is APK aplication and second is AAR library.
Application has dependency on library.
Project has -SNAPSHOT version.
I nevery build this project before

When I build the project with "mvn package" it correctly build the library first and result copy to the app/target/unpacked-libs/eial_android-about_2.0.5-SNAPSHOT
But during compile it add on classpath this path 
target/unpacked-libs/eial_android-about_2.0.5-20150112.101322-7/classes.jar

And compilation will fail.
It loook that the plugin will download the AAR library from the remote repository where is latest SNAPSHOT with version 2.0.5-20150112.101322-7 instead of use build target of the library module.

Only way to build this project is call
mvn install
It will also fail during first run on the app module, but it deploy library part to the local repo and next call "mvn package" will already found android-about-2.0.5-SNAPSHOT in the local repo and will use this name in the classpath.

William Ferguson

unread,
Jan 27, 2015, 5:25:19 PM1/27/15
to maven-androi...@googlegroups.com
That is correct.

When AAR dependencies are resolved they are pulled from the  local repo. If you have run 'mvn package' then your AAR will not have been published to the repo.

William

Tomáš Procházka

unread,
Jan 30, 2015, 5:48:34 AM1/30/15
to maven-androi...@googlegroups.com
Really? I think that it is bug, it is not common behavior of maven.
If you have normal Java project (or web project) you are always able to run "mvn package" without deploy it to local repo first.
It must be possible to use one module as dependency for another one.
Maven plugin should use .aar file from build folder instead of .aar from local or remote repository.


Dne úterý 27. ledna 2015 23:25:19 UTC+1 William Ferguson napsal(a):

Tomáš Procházka

unread,
Jan 30, 2015, 6:25:24 AM1/30/15
to maven-androi...@googlegroups.com
Bug is only in the building of the classpath for compilation. 
Android maven plugin correctly unpack aar builded with one module to the another (where it is used) but use different path in the compilation command.

Dne pátek 30. ledna 2015 11:48:34 UTC+1 Tomáš Procházka napsal(a):

William Ferguson

unread,
Jan 30, 2015, 6:35:30 AM1/30/15
to maven-androi...@googlegroups.com

Cool. Look forward to your pull request to resolve it.

--
You received this message because you are subscribed to a topic in the Google Groups "Maven Android Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/maven-android-developers/AdLn3i2EJEw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to maven-android-deve...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages