Essential Resources When Building Android Apps Using Maven (and Eclipse)
If you plan to build your Android application on a build server like Jenkins, Hudson, etc ... you should switch from building your project with your IDE (in my case Eclipse) to a build system like Maven or Gradle.
I tried Gradle but was totally disapointed by the poor performance. So I decided to use maven instead and found out about these resources which you have to read and understand:
- Maven Android Plugin:
You need the plugin to build android projects using maven. With Android API 17 the latest stable release 3.5.3 doesn't work. You have to pull the plugin's source from GitHub and build version 3.5.4-SNAPSHOT by yourself.
- Android SDK Deployer:
"Typically artifacts are available in Maven Central, however only the platform versions available in the Android Open Source Project are published to Maven Central. Newer versions of the platform as well as the compatibility package and proprietary extensions like the Google Maps support are not available there and need to be published to your Maven repository, if you want to use them in your Android project.
The artifacts published to Maven central are available as dependencies under the groupId com.google.android with the artifactId android and android-test.
The Maven Android SDK Deployer has been created to publish artifacts from the Android SDK into your local repository or repository server when using components that are not available in Central."
I have taken this from the online book Maven - The Complete Reference by Sonatype.
With Android API 17 you might run into the same bug like described above. So before building this project you must build version 3.5.4-SNAPSHOT of the Maven Android Plugin
In case you use Eclipse, you can use this m2e plugin to add maven support to your Eclipse Android project.
(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)