Fork me on GitHub

Android Maven Plugin

The Android Maven Plugin is used to build applications for the Android operating system as well as build libraries to be used in these efforts in AAR and the legacy APKLIB format using Apache Maven.

The plugin includes numerous features with some minimal setup for usage. The main tasks are creating an application or a library for reuse:

  • Create an Android application using apk packaging

  • Create an Android Archive for code/resources reuse using aar packaging

  • Create an Android Application Library (to be deprecated) for code/resources reuse using apklib packaging

It includes support for running instrumentation tests, analysis with Android Lint, processing with ProGuard and many other tasks.

Supplementary tasks helping these efforts supported are:

Required Setup

  • Android SDK r21.1 or later, latest is best supported

  • Java Development Kit 1.7 - 1.8 as supported by the Android SDK

  • Apache Maven 3.0.5+

  • Environment variables and PATH settings:

    • Set ANDROID_HOME to point to the path of your installed Android SDK

    • $ANDROID_HOME/tools as well as $ANDROID_HOME/platform-tools to your $PATH

    • Or on Windows %ANDROID_HOME%\tools and %ANDROID_HOME%\platform-tools

  • Optionally Android NDK and ANDROID_NDK_HOME set

Getting Started

The best examples for project setups are the example projects that are part of the plugin code base and are run with each build and release.

Further Information and Help