Full name:
com.simpligility.maven.plugins:android-maven-plugin:4.6.0:apk
Description:
Attributes:
Name | Type | Since | Description |
---|---|---|---|
aaptExtraArgs | String[] | - | A list of extra arguments that must be passed to aapt. User property is: android.aaptExtraArgs. |
aaptVerbose | boolean | - | Activate verbose output for the aapt execution in Maven debug mode.
Defaults to "false" User property is: android.aaptVerbose. |
adbConnectionTimeout | int | - | The timeout value for an adb connection in milliseconds. Default value is: 5000. User property is: android.adb.connectionTimeout. |
androidManifestFile | File | - | The AndroidManifest.xml file. Default value is: ${project.basedir}/src/main/AndroidManifest.xml. User property is: android.manifestFile. |
apk | Apk | - | Embedded configuration of this mojo. |
apkDebug | Boolean | - | Defines whether or not the APK is being produced in debug mode or
not. User property is: android.apk.debug. |
apkNativeToolchain | String | - | (no description) User property is: android.nativeToolchain. |
artifactSet | IncludeExcludeSet | - | Allows to include or exclude artifacts by groupId,
artifactId, and versionId. The
include parameter has higher priority than the
exclude parameter. These two parameters can override
the artifactTypeSet and skipDependencies
parameters. Artifact groupId, artifactId,
and versionId are specified by a string with the
respective values separated using a colon character :.
artifactId and versionId can be optional
covering an artifact range. Empty strings are ignored. Example:
<artifactTypeSet> <includes> <include>foo-group:foo-artifact:1.0-SNAPSHOT</include> <include>bar-group:bar-artifact:1.0-SNAPSHOT</include> <include>baz-group:*</include> <includes> <excludes> <exclude>qux-group:qux-artifact:*</exclude> <excludes> </artifactTypeSet> User property is: artifactSet. |
artifactTypeSet | IncludeExcludeSet | - | Allows to include or exclude artifacts by type. The
include parameter has higher priority than the
exclude parameter. These two parameters can be
overridden by the artifactSet parameter. Empty strings
are ignored. Example:
<artifactTypeSet> <includes> <include>aar</include> <includes> <excludes> <exclude>jar</exclude> <excludes> </artifactTypeSet> User property is: artifactTypeSet. |
assetsDirectory | File | - | The android assets directory. Default value is: ${project.basedir}/src/main/assets. |
attachJar | boolean | - |
Whether to attach the normal .jar file to the build, so it can be depended on by for example integration-tests which may then access R.java from this project. Only disable it if you know you won't need it for any integration-tests. Otherwise, leave it enabled. Default value is: true. User property is: android.attachJar. |
attachSources | boolean | - |
Whether to attach sources to the build, which can be depended on by other apk projects, for including them in their builds. Enabling this setting is only required if this project's source code and/or res(ources) will be included in other projects, using the Maven <dependency> tag. Default value is: false. User property is: android.attachSources. |
classifier | String | - |
Classifier to add to the artifact generated. If given, the artifact will be an attachment instead. |
configurations | String | - | A selection of configurations to be included in the APK as a comma
separated list. This will limit the configurations for a certain
type. For example, specifying hdpi will exclude all
resource folders with the mdpi or ldpi
modifiers, but won't affect language or orientation modifiers. For
more information about this option, look in the aapt command line
help. User property is: android.configurations. |
customPackage | String | - | Generates R.java into a different package. User property is: android.customPackage. |
destinationManifestFile | File | - | Path to which to save the result of updating/merging/processing the
source AndroidManifest.xml file
(androidManifestFile). Default value is: ${project.build.directory}/AndroidManifest.xml. User property is: destination.manifestFile. |
device | String | - | Specifies which the serial number of the device to connect to.
Using the special values "usb" or "emulator" is also valid. "usb"
will connect to all actual devices connected (via usb). "emulator"
will connect to all emulators connected. Multiple devices will be
iterated over in terms of goals to run. All device interaction
goals support this so you can e.. deploy the apk to all attached
emulators and devices. Goals supporting this are devices, deploy,
undeploy, redeploy, pull, push and instrument. User property is: android.device. |
deviceThreads | int | - |
Specifies the number of threads to use for deploying and testing on attached devices. This parameter can also be configured from command-line with parameter -Dandroid.deviceThreads=2. User property is: android.deviceThreads. |
devices | String[] | - |
Specifies a list of serial numbers of each device you want to connect to. Using the special values "usb" or "emulator" is also valid. "usb" will connect to all actual devices connected (via usb). "emulator" will connect to all emulators connected. Multiple devices will be iterated over in terms of goals to run. All device interaction goals support this so you can e.. deploy the apk to all attached emulators and devices. Goals supporting this are devices, deploy, undeploy, redeploy, pull, push and instrument. <devices> <device>usb</device> <device>emulator-5554</device> </devices> This parameter can also be configured from command-line with parameter -Dandroid.devices=usb,emulator. User property is: android.devices. |
disableConflictingDependenciesWarning | File | - | Whether the plugin should show a warning if conflicting
dependencies with the Android provided ones exist. Default value is: false. |
excludeJarResources | String[] | - | Specify a list of patterns that are matched against the names of
jar file dependencies. Matching jar files will not have their
resources added to the resulting APK. The patterns are standard
Java regexes. |
extractDuplicates | boolean | - |
Allows to detect and extract the duplicate files from embedded jars. In that case, the plugin analyzes the content of all embedded dependencies and checks they are no duplicates inside those dependencies. Indeed, Android does not support duplicates, and all dependencies are inlined in the APK. If duplicates files are found, the resource is kept in the first dependency and removes from others. Default value is: false. User property is: android.extractDuplicates. |
genDirectory | File | - | Override default generated folder containing R.java Default value is: ${project.build.directory}/generated-sources/r. User property is: android.genDirectory. |
generateApk | boolean | - | Decides whether the Apk should be generated or not. If set to
false, dx and apkBuilder will not run. This is probably most useful
for a project used to generate apk sources to be inherited into
another application project. Default value is: true. User property is: android.generateApk. |
includeLibsJarsFromAar | boolean | - |
Include jars stored in the libs folder of an aar as dependencies. Do not delete or change name as it is used in the LifeCycleParticipant. Default value is: true. |
includeLibsJarsFromApklib | boolean | - |
Include jars stored in the libs folder of an apklib as dependencies. Do not delete or change name as it is used in the LifeCycleParticipant. Default value is: false. |
ips | String[] | - |
External IP addresses. The connect goal of the android maven plugin will execute an adb connect on each IP address. If you have external dervice, you should call this connect goal before any other goal : mvn clean android:connect install. The Maven plugin will automatically add all these IP addresses into the the devices parameter. If you want to disconnect the IP addresses after the build, you can call the disconnect goal : mvn clean android:connect install android:disconnect <ips> <ip>127.0.0.1:5556</ip> </ips> User property is: android.ips. |
jack | Jack | - | configure the Jack compiler |
nativeLibrariesDependenciesHardwareArchitectureDefault | String | - |
Default hardware architecture for native library dependencies (with <type>so</type>) without a classifier. Valid values currently include armeabi, armeabi-v7a, mips and x86. Default value is: armeabi. User property is: android.nativeLibrariesDependenciesHardwareArchitectureDefault. |
nativeLibrariesDirectory | File | - |
Root folder containing native libraries to include in the application package. Default value is: ${project.basedir}/src/main/libs. User property is: android.nativeLibrariesDirectory. |
ndk | Ndk | - |
The Android NDK to use. Looks like this: <ndk> <path>/opt/android-ndk-r4</path> </ndk> The <path> parameter is optional. The default is the setting of the ANDROID_NDK_HOME environment variable. The parameter can be used to override this setting with a different environment variable like this: <ndk> <path>${env.ANDROID_NDK_HOME}</path> </ndk> or just with a hardcoded absolute path. The parameters can also be configured from command-line with parameter -Dandroid.ndk.path. |
ndkFinalLibraryName | String | - | Specifies the final name of the library output by the build (this
allows User property is: android.ndk.build.build.final-library.name. |
outputApk | String | - | The apk file produced by the apk goal. Per default the file is
placed into the build directory (target normally) using the build
final name and apk as extension. Default value is: ${project.build.directory}/${project.build.finalName}.apk. User property is: android.outputApk. |
pluginMetaInf | MetaInf | - | (no description) |
proguardFile | File | - | Automatically create a ProGuard configuration file that will guard
Activity classes and the like that are defined in the
AndroidManifest.xml. This files is then automatically used in the
proguard mojo execution, if enabled. User property is: android.proguardFile. |
release | boolean | - | Whether to create a release build (default is false / debug build).
This affect BuildConfig generation and apk generation at this
stage, but should probably affect other aspects of the build. Default value is: false. User property is: android.release. |
renameInstrumentationTargetPackage | String | - |
Rewrite the manifest so that all of its instrumentation components target the given package. This value will be passed on to the aapt parameter --rename-instrumentation-target-package. Look to aapt for more help on this. TODO pass this into AaptExecutorUser property is: android.renameInstrumentationTargetPackage. |
renameManifestPackage | String | - |
A possibly new package name for the application. This value will be passed on to the aapt parameter --rename-manifest-package. Look to aapt for more help on this. User property is: android.renameManifestPackage. |
resourceDirectory | File | - | The Android resources (src/main/res) directory. Note that this is
different from the Maven/Java resources directory
(src/main/resources) and should not be set to be the same since
different processing is carried out on these folder by different
plugins and tools. Default value is: ${project.basedir}/src/main/res. |
resourceOverlayDirectories | File[] | - | The android resources overlay directories. If this is specified,
the resourceOverlayDirectory parameter will be
ignored. |
resourceOverlayDirectory | File | - | The android resources overlay directory. This will be overridden by
resourceOverlayDirectories if present. Default value is: ${project.basedir}/res-overlay. |
sdk | Sdk | - |
The Android SDK to use. Looks like this: <sdk> <path>/opt/android-sdk-linux</path> <platform>2.1</platform> </sdk> The <platform> parameter is optional, and corresponds to the platforms/android-* directories in the Android SDK directory. Default is the latest available version, so you only need to set it if you for example want to use platform 1.5 but also have e.g. 2.2 installed. Has no effect when used on an Android SDK 1.1. The parameter can also be coded as the API level. Therefore valid values are 1.1, 1.5, 1.6, 2.0, 2.01, 2.1, 2.2 and so as well as 3, 4, 5, 6, 7, 8... 19. If a platform/api level is not installed on the machine an error message will be produced. The <path> parameter is optional. The default is the setting of the ANDROID_HOME environment variable. The parameter can be used to override this setting with a different environment variable like this: <sdk> <path>${env.ANDROID_SDK}</path> </sdk> or just with a hard-coded absolute path. The parameters can also be configured from command-line with parameters -Dandroid.sdk.path and -Dandroid.sdk.platform. |
sign | Sign | - |
How to sign the apk. Looks like this: <sign> <debug>auto</debug> </sign> Valid values for <debug> are:
Can also be configured from command-line with parameter -Dandroid.sign.debug. |
skipDependencies | boolean | - | Skips transitive dependencies. May be useful if the target classes
directory is populated with the
maven-dependency-plugin and already contains all
dependency classes. Default value is: false. User property is: skipDependencies. |
sourceDirectories | File[] | - |
Additional source directories that contain resources to be packaged into the apk. These are not source directories, that contain java classes to be compiled. It corresponds to the -df option of the apkbuilder program. It allows you to specify directories, that contain additional resources to be packaged into the apk. So an example inside the plugin configuration could be:<configuration> ... <sourceDirectories> <sourceDirectory>${project.basedir}/additionals</sourceDirectory> </sourceDirectories> ... </configuration> User property is: android.sourceDirectories. |
transformers | ResourceTransformer[] | - | (no description) |
undeployBeforeDeploy | boolean | - |
Whether to undeploy an apk from the device before deploying it. Only has effect when running mvn android:deploy in an Android application project manually, or when running mvn integration-test (or mvn install) in a project with instrumentation tests. It is useful to keep this set to true at all times, because if an apk with the same package was previously signed with a different keystore, and deployed to the device, deployment will fail because your keystore is different. Default value is: false. User property is: android.undeployBeforeDeploy. |
unpackedLibsFolder | File | - | Folder in which AAR library dependencies will be unpacked. Default value is: ${project.build.directory}/unpacked-libs. User property is: unpackedLibsFolder. |
apk:
<artifactTypeSet> <includes> <include>foo-group:foo-artifact:1.0-SNAPSHOT</include> <include>bar-group:bar-artifact:1.0-SNAPSHOT</include> <include>baz-group:*</include> <includes> <excludes> <exclude>qux-group:qux-artifact:*</exclude> <excludes> </artifactTypeSet>
<artifactTypeSet> <includes> <include>aar</include> <includes> <excludes> <exclude>jar</exclude> <excludes> </artifactTypeSet>
Whether to attach the normal .jar file to the build, so it can be depended on by for example integration-tests which may then access R.java from this project.
Only disable it if you know you won't need it for any integration-tests. Otherwise, leave it enabled.
Whether to attach sources to the build, which can be depended on by other apk projects, for including them in their builds.
Enabling this setting is only required if this project's source code and/or res(ources) will be included in other projects, using the Maven <dependency> tag.
Classifier to add to the artifact generated. If given, the artifact will be an attachment instead.
Specifies the number of threads to use for deploying and testing on attached devices.
This parameter can also be configured from command-line with parameter -Dandroid.deviceThreads=2.
Specifies a list of serial numbers of each device you want to connect to. Using the special values "usb" or "emulator" is also valid. "usb" will connect to all actual devices connected (via usb). "emulator" will connect to all emulators connected. Multiple devices will be iterated over in terms of goals to run. All device interaction goals support this so you can e.. deploy the apk to all attached emulators and devices. Goals supporting this are devices, deploy, undeploy, redeploy, pull, push and instrument.
<devices> <device>usb</device> <device>emulator-5554</device> </devices>
This parameter can also be configured from command-line with parameter -Dandroid.devices=usb,emulator.
disableConflictingDependenciesWarning:
Allows to detect and extract the duplicate files from embedded jars. In that case, the plugin analyzes the content of all embedded dependencies and checks they are no duplicates inside those dependencies. Indeed, Android does not support duplicates, and all dependencies are inlined in the APK. If duplicates files are found, the resource is kept in the first dependency and removes from others.
Include jars stored in the libs folder of an aar as dependencies. Do not delete or change name as it is used in the LifeCycleParticipant.
Include jars stored in the libs folder of an apklib as dependencies. Do not delete or change name as it is used in the LifeCycleParticipant.
ips:
External IP addresses. The connect goal of the android maven plugin will execute an adb connect on each IP address. If you have external dervice, you should call this connect goal before any other goal : mvn clean android:connect install.
The Maven plugin will automatically add all these IP addresses into the the devices parameter. If you want to disconnect the IP addresses after the build, you can call the disconnect goal : mvn clean android:connect install android:disconnect
<ips> <ip>127.0.0.1:5556</ip> </ips>
jack:
nativeLibrariesDependenciesHardwareArchitectureDefault:
Default hardware architecture for native library dependencies (with <type>so</type>) without a classifier.
Valid values currently include armeabi, armeabi-v7a, mips and x86.
Root folder containing native libraries to include in the application package.
ndk:
The Android NDK to use.
Looks like this:
<ndk> <path>/opt/android-ndk-r4</path> </ndk>
The <path> parameter is optional. The default is the setting of the ANDROID_NDK_HOME environment variable. The parameter can be used to override this setting with a different environment variable like this:
<ndk> <path>${env.ANDROID_NDK_HOME}</path> </ndk>
or just with a hardcoded absolute path. The parameters can also be configured from command-line with parameter -Dandroid.ndk.path.
renameInstrumentationTargetPackage:
Rewrite the manifest so that all of its instrumentation components target the given package. This value will be passed on to the aapt parameter --rename-instrumentation-target-package. Look to aapt for more help on this.
TODO pass this into AaptExecutorA possibly new package name for the application. This value will be passed on to the aapt parameter --rename-manifest-package. Look to aapt for more help on this.
sdk:
The Android SDK to use.
Looks like this:
<sdk> <path>/opt/android-sdk-linux</path> <platform>2.1</platform> </sdk>
The <platform> parameter is optional, and corresponds to the platforms/android-* directories in the Android SDK directory. Default is the latest available version, so you only need to set it if you for example want to use platform 1.5 but also have e.g. 2.2 installed. Has no effect when used on an Android SDK 1.1. The parameter can also be coded as the API level. Therefore valid values are 1.1, 1.5, 1.6, 2.0, 2.01, 2.1, 2.2 and so as well as 3, 4, 5, 6, 7, 8... 19. If a platform/api level is not installed on the machine an error message will be produced.
The <path> parameter is optional. The default is the setting of the ANDROID_HOME environment variable. The parameter can be used to override this setting with a different environment variable like this:
<sdk> <path>${env.ANDROID_SDK}</path> </sdk>
or just with a hard-coded absolute path. The parameters can also be configured from command-line with parameters -Dandroid.sdk.path and -Dandroid.sdk.platform.
sign:
How to sign the apk.
Looks like this:
<sign> <debug>auto</debug> </sign>
Valid values for <debug> are:
Can also be configured from command-line with parameter -Dandroid.sign.debug.
Additional source directories that contain resources to be packaged into the apk.
These are not source directories, that contain java classes to be compiled. It corresponds to the -df option of the apkbuilder program. It allows you to specify directories, that contain additional resources to be packaged into the apk.
So an example inside the plugin configuration could be:<configuration> ... <sourceDirectories> <sourceDirectory>${project.basedir}/additionals</sourceDirectory> </sourceDirectories> ... </configuration>
Whether to undeploy an apk from the device before deploying it.
Only has effect when running mvn android:deploy in an Android application project manually, or when running mvn integration-test (or mvn install) in a project with instrumentation tests.
It is useful to keep this set to true at all times, because if an apk with the same package was previously signed with a different keystore, and deployed to the device, deployment will fail because your keystore is different.