Goals available for this plugin:
| Goal | Description |
|---|---|
| android:apk | Creates the apk file. By default signs it with debug
keystore. Change that by setting configuration parameter <sign><debug>false</debug></sign>. |
| android:apklib | Creates the apklib file. apklib files do not generate deployable artifacts. |
| android:clean | No description. |
| android:deploy | Deploys the built apk file, or another specified apk, to a
connected device. Automatically performed when running mvn
integration-test (or mvn install) on a project
with instrumentation tests. |
| android:deploy-dependencies | Deploys all directly declared dependencies of
<type>apk</type> in this project's
pom.Usually used in a project with instrumentation tests, to deploy the apk to test onto the device before running the deploying and running the instrumentation tests apk. Automatically performed when running mvn
integration-test (or mvn install) on a project
with instrumentation tests. |
| android:dex | Converts compiled Java classes to the Android dex format. |
| android:emma | After compiled Java classes use emma tool |
| android:emulator-start | EmulatorStartMojo can start the Android Emulator with a specified Android Virtual Device (avd). |
| android:emulator-stop | EmulatorStartMojo can stop the Android Emulator with a specified Android Virtual Device (avd). |
| android:emulator-stop-all | EmulatorStopeAllMojo will stop all attached devices. |
| android:generate-sources | Generates R.java based on resources specified by the
resources configuration parameter.Generates java files based on aidl files. |
| android:help | Display help information on android-maven-plugin. Call mvn android:help -Ddetail=true -Dgoal=<goal-name>to display parameter details. |
| android:instrument | Runs the instrumentation apk on device. |
| android:internal-integration-test | Internal. Do not use. Called automatically when the lifecycle reaches phase integration-test. Figures out whether to call goals in
this phase; and if so, calls android:instrument. |
| android:internal-pre-integration-test | Internal. Do not use. Called automatically when the lifecycle reaches phase pre-integration-test. Figures out whether to call
goals in this phase; and if so, calls
android:deploy-dependencies and
android:deploy. |
| android:manifest-update | Updates various version attributes present in the
AndroidManifest.xml file. |
| android:ndk-build | No description. |
| android:proguard | Processes both application and dependency classes using the ProGuard byte code obfuscator, minimzer, and optimizer. For more information, see https://proguard.sourceforge.net. |
| android:pull | Copy file or directory from all the attached (or specified) devices/emulators. |
| android:push | Copy file to all the attached (or specified) devices/emulators. |
| android:redeploy | Redeploys the built apk file, or another specified apk, to a connected device. This simply tries to undeploy the APK and re-deploy it. |
| android:run | Runs the first Activity shown in the top-level launcher as
determined by its Intent filters.
Android provides a component-based architecture, which means that there is no "main" function which serves as an entry point to the APK. There's an homogeneous collection of Activity(es), Service(s), Receiver(s), etc. The Android top-level launcher (whose purpose is to allow users to launch other applications) uses the Intent resolution mechanism to determine which Activity(es) to show to the end user. Such activities are identified by at least:
And are declared in
<activity android:name=".ExampleActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
This The device parameter is taken into consideration so potentially the Activity found is started on all attached devices. The application will NOT be deployed and running will silently fail if the application is not deployed. |
| android:undeploy | Undeploys the built apk file, or another specified apk, from a
connected device. |
| android:unpack | Unpack libraries code and dependencies into target. This can be useful for using the proguard maven plugin to provide the input jars. Although it is encouraged to use the proguard mojo of the android maven plugin. |
| android:zipalign | ZipalignMojo can run the zipalign command against the apk. |
The following specifies the minimum requirements to run this Maven plugin:
| Maven | [3.0.3,) |
| JDK | 1.6 |
| Memory | No minimum requirement. |
| Disk Space | No minimum requirement. |
You should specify the version in your project's plugin configuration:
<project>
...
<build>
<!-- To define the plugin version in your parent POM -->
<pluginManagement>
<plugins>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<version>3.2.0</version>
</plugin>
...
</plugins>
</pluginManagement>
<!-- To use the plugin goals in your POM or parent POM -->
<plugins>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<version>3.2.0</version>
</plugin>
...
</plugins>
</build>
...
</project>
For more information, see "Guide to Configuring Plug-ins"