compilation error when using maven apklib - android

I create a library project and packing as apklib. In application I added depedency:
<dependency>
<groupId>com.ati</groupId>
<artifactId>common-lib</artifactId>
<version>0.0.1-SNAPSHOT</version>
<type>apklib</type>
</dependency>
I use lib in my app project like: com.ati.common_lib.Test.demo(); and use mvn clean install. It worked! But if I use import com.ati.common_lib; and Test.demo(); and mvn clean build it throw the error
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project soci-news: Compilation failure: Compilation failure:
[ERROR] /Data/Work/workspace/soci-parent/soci-news/src/main/java/com/ati/soci_news/HelloAndroidActivity.java:[9,15] cannot find symbol
[ERROR] symbol : class common_lib
[ERROR] location: package com.ati
[ERROR] /Data/Work/workspace/soci-parent/soci-news/src/main/java/com/ati/soci_news/HelloAndroidActivity.java:[23,9] cannot find symbol
[ERROR] symbol : variable Test
[ERROR] location: class com.ati.soci_news.HelloAndroidActivity
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :soci-news
I am using maven 3.0.5, eclipse "kepler version" with m2e-android. Library and app I created by m2e-android. What am I doing wrong here?
UPDATE
My parent pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.ati</groupId>
<artifactId>soci-parent</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Soci project parent</name>
<modules>
<module>common-lib</module>
<module>soci-news</module>
</modules>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>android</artifactId>
<version>2.2.1</version>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<version>3.6.1</version>
<configuration>
<sdk>
<platform>8</platform>
</sdk>
<undeployBeforeDeploy>true</undeployBeforeDeploy>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
My library pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.ati</groupId>
<artifactId>soci-parent</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<groupId>com.ati</groupId>
<artifactId>common-lib</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>apklib</packaging>
<name>common lib for ati android application</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<platform.version> 2.2.1
</platform.version>
<android.plugin.version>3.6.1</android.plugin.version>
</properties>
<dependencies>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>android</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<extensions>true</extensions>
</plugin>
</plugins>
</build>
</project>
My app's pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.ati</groupId>
<artifactId>soci-parent</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<groupId>com.ati</groupId>
<artifactId>soci-news</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>apk</packaging>
<name>soci-news</name>
<dependencies>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>android</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.ati</groupId>
<artifactId>common-lib</artifactId>
<version>0.0.1-SNAPSHOT</version>
<type>apklib</type>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<extensions>true</extensions>
</plugin>
</plugins>
</build>
</project>

Your import is broken.
com.ati.common-lib is the package, but you really want to import the contents of that package, com.ati.common-lib.* for everything and com.ati.common-lib.Test for just the Test class.

Related

NullPointerException when trying build a android application with maven and plugin com.jayway.maven.plugins.android.generation2

I am trying building a android application with maven and this pom.xml:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.kleber</groupId>
<artifactId>app</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>apk</packaging>
<name>app</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<platform.version> 4.1.1.4</platform.version>
</properties>
<dependencies>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>android</artifactId>
<version>${platform.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<finalName>${project.artifactId}</finalName>
<pluginManagement>
<plugins>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<version>3.8.2</version>
<extensions>true</extensions>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<configuration>
<sdk>
<platform>16</platform>
</sdk>
<emulator>
<avd>avd</avd>
</emulator>
</configuration>
</plugin>
</plugins>
</build>
</project>
and keeping getting this error:
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.213 s
[INFO] Finished at: 2019-09-25T22:03:34-03:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.9.0-rc.2:generate-sources (default-generate-sources) on project app: Execution default-generate-sources of goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.9.0-rc.2:generate-sources failed.: NullPointerException -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
Anyone can tell what's the problem here?

android-maven-plugin packaging failed with hierarchical project and apklib dependency

I have main root project let's call it as A where is pom.xml with list of all modules and type of packaging pom
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>A</artifactId>
<version>0.0.1</version>
<packaging>pom</packaging>
<properties>
<android.version>4.1.1.4</android.version>
<android.target.version>17</android.target.version>
<android.plugin.version>3.6.0</android.plugin.version>
<android.roboelectric.version>2.2</android.roboelectric.version>
<android.support.version.4>r7</android.support.version.4>
</properties>
<modules>
<module>AA</module>
<module>AB</module>
</modules>
This project has two children lest say project AA and AB also with poms
project AA is packaging type apklib and has nop problems with compilation installation also over android-maven-plugin (android:apklib) here is pom
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.example</groupId>
<artifactId>A</artifactId>
<version>0.0.1</version>
</parent>
<groupId>com.example</groupId>
<artifactId>AB</artifactId>
<packaging>apklib</packaging>
<build>
<finalName>${project.artifactId}-${project.parent.version}</finalName>
<pluginManagement>
<plugins>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<version>${android.plugin.version}</version>
<extensions>true</extensions>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<configuration>
<sdk>
<platform>17</platform>
<path>${env.ANDROID_HOME}</path>
</sdk>
</configuration>
</plugin>
</plugins>
</build>
project AB has dependency to project AA in pom like bellow
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.example</groupId>
<artifactId>A</artifactId>
<version>0.0.1</version>
</parent>
<groupId>com.example</groupId>
<artifactId>AB</artifactId>
<packaging>apklib</packaging>
<dependencies>
<dependency>
<groupId>com.examplet</groupId>
<artifactId>AA</artifactId>
<version>0.0.1</version>
<type>apklib</type>
</dependency>
</dependencies>
<build>
<finalName>${project.artifactId}-${project.version}</finalName>
<pluginManagement>
<plugins>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<version>${android.plugin.version}</version>
<extensions>true</extensions>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<configuration>
<sdk>
<platform>17</platform>
</sdk>
</configuration>
</plugin>
</plugins>
</build>
During packaging or even android:apklib I'm geeting error something like this
Failed to execute goal on project util: Could not resolve dependencies
for project com.example.AB:apklib:0.0.1: Failed to collect
dependencies for [com.example.AA:apklib:0.0.1 (provided)]: Failed to
read artifact descriptor for com.example.AA:apklib:0.0.1: Could not
find artifact com.example:A:pom:0.0.1 in central
(http://repo.maven.apache.org/maven2) -> [Help 1]
I have runned mvn install on project AA and looks that it's installed in .m2
Any ideas? Thanks in advance.
Ok I resolved the issue the problem was that I have changed root pom without installing it so I just runned once again mvn install on root project and that resolved the issue.

Android library project -exporting in jar format working in eclipse and ant but not in maven

I have a android library project . I create a jar . now I copied the jar to the libs folder in a android application and build apk using eclipse and ant . the apk file is working but when I try to build using maven the apk file is not working .I have this issue from long time.
Can you correct if I made any mistake in pom file.
pom file for android application :
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.project.servicefoundation</groupId>
<artifactId>projectservicefoundation</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>apk</packaging>
<name>projectserviceFoundation</name>
<dependencies>
<dependency>
<groupId>com.project.servicefoundation</groupId>
<artifactId>androidsdk</artifactId>
<version>0.0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>android</artifactId>
<version>4.1.1.4</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>android-test</artifactId>
<version>2.3.1</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<finalName>${project.artifactId}</finalName>
<sourceDirectory>src</sourceDirectory>
<pluginManagement>
<plugins>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<version>3.5.3</version>
<extensions>true</extensions>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<executions>
<execution>
<id>androidsdktests</id>
<phase>test</phase>
<goals>
<goal>
emulator-start
</goal>
<goal>
internal-integration-test
</goal>
</goals>
</execution>
</executions>
<configuration>
<sdk>
<!-- platform or api level (api level 4 = platform 1.6) -->
<platform>19</platform>
</sdk>
<emulator>
<avd>mydevice</avd>
<!-- Wait for emulator starting (3 minutes) -->
<wait>180000</wait>
<options>-no-skin</options>
</emulator>
</configuration>
</plugin>
</plugins>
</build>
</project>
pom file for the android library project
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.project.servicefoundation</groupId>
<artifactId>androidsdk</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>AndroidSDK</name>
<dependencies>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>android</artifactId>
<version>2.2.1</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>
The name of android library project is androidsdk.
You've declared your dependency to androidsdk as provided, which means it will not be included in your apk (which explains why it does not work) :
<dependency>
<groupId>com.project.servicefoundation</groupId>
<artifactId>androidsdk</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
Simply removing <scope>provided</scope> should do the trick.

getting error when tried to build app with maven

I am trying to build my app using maven. There are 3 projects in my app, 2 library projects and 1 main project. I am using 4.2.2 version of android.since there is no dependency available in maven repository for 4.2.2 version i have manually installed the android.jar file to my local repository. When i tried to build my project i am getting below error on main project. 2 library projects and parent pom files are building properly.
[ERROR] Error when generating sources.
org.apache.maven.plugin.MojoExecutionException:
at com.jayway.maven.plugins.android.phase01generatesources.GenerateSourcesMojo.generateR(GenerateSourcesMojo.java:478)
at com.jayway.maven.plugins.android.phase01generatesources.GenerateSourcesMojo.execute(GenerateSourcesMojo.java:193)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: com.jayway.maven.plugins.android.ExecutionException: ANDROID-040-001: Could not execute: Command = cmd.exe /X /C "D:\Android\android-sdk\platf
orm-tools\aapt.exe package -m -J D:\Development\Android\1.Projects\SAFE-0460-01-00\SafewayWorkspace\maven\3.2_rc\Safeway\target\generated-sources\r -M D:
\Development\Android\1.Projects\SAFE-0460-01- 00\SafewayWorkspace\maven\3.2_rc\Safeway\AndroidManifest.xml -S D:\Development\Android\1.Projects\SAFE-0460-
01-00\SafewayWorkspace\maven\3.2_rc\Safeway\res -S D:\Development\Android\1.Projects\SAFE-0460-01-00\SafewayWorkspace\maven\3.2_rc\Safeway\target\unpack\
apklibs/com.safeway.justforu_android-mapviewballoons_apklib_1.0.0-SNAPSHOT/res -S D:\Development\Android\1.Projects\SAFE-0460-01-00\SafewayWorkspace\mave
n\3.2_rc\Safeway\target\unpack\apklibs/com.safeway.justforu_AndroidClient_apklib_1.0.0-SNAPSHOT/res --auto-add-overlay -A D:\Development\Android\1.Projec
ts\SAFE-0460-01-00\SafewayWorkspace\maven\3.2_rc\Safeway\assets -I D:\Android\android-sdk\platforms\android-17\android.jar", Result = 1
at com.jayway.maven.plugins.android.CommandExecutor$Factory$1.executeCommand(CommandExecutor.j va:339)
at com.jayway.maven.plugins.android.phase01generatesources.GenerateSourcesMojo.generateR(GenerateSourcesMojo.java:474)
... 22 more
This is my main project POM file.
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.app.pack</groupId>
<artifactId>libraryprojects-parent</artifactId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<groupId>com.app.pack</groupId>
<artifactId>MainProj</artifactId>
<packaging>apk</packaging>
<name>MainProj</name>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>android</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.android.support-v4</groupId>
<artifactId>android-support-v4</artifactId>
<version>r6-googlemaps</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.google.amazon.maps</groupId>
<artifactId>maps</artifactId>
<version>1.0.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.android.maps</groupId>
<artifactId>maps</artifactId>
<version>17_r1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.lib.proj1</groupId>
<artifactId>libproj1</artifactId>
<version>1.0.0-SNAPSHOT</version>
<type>apklib</type>
</dependency>
<dependency>
<groupId>com.lib.proj2</groupId>
<artifactId>libproj2</artifactId>
<version>1.0.0-SNAPSHOT</version>
<type>apklib</type>
</dependency>
<dependency>
<groupId>com.google.android.ensighten</groupId>
<artifactId>Ensighten</artifactId>
<version>1.0</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>com.google.android.ensighten</groupId>
<artifactId>EnsightenAspect</artifactId>
<version>1.0</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>aspectjrt</artifactId>
<version>1.0</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>android-async-http</artifactId>
<version>1.4.3</version>
<type>jar</type>
</dependency>
</dependencies>
<build>
<sourceDirectory>src</sourceDirectory>
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<extensions>true</extensions>
</plugin>
</plugins>
</build>
And this is my parent POM file
http://maven.apache.org/maven-v4_0_0.xsd">
4.0.0
com.app.pack
libraryprojects-parent
1.0.0-SNAPSHOT
pom
Library Projects Parent
com.google.android
android
4.2.2
com.google.android
android-test
4.1.1.4
</dependencies>
</dependencyManagement>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<sdk>
<platform>17</platform>
</sdk>
<undeployBeforeDeploy>true</undeployBeforeDeploy>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>

Android maven install fails with external project

This is my projects POM.XML file
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.mycomp</groupId>
<artifactId>abc</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>apk</packaging>
<name>xyx</name>
<dependencies>
<dependency>
<groupId>org.springframework.android</groupId>
<artifactId>spring-android-rest-template</artifactId>
<version>1.0.1.RELEASE</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<version>1.9.8</version>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>20030203.000129</version>
</dependency>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>android</artifactId>
<version>4.1.1.4</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.actionbarsherlock</groupId>
<artifactId>actionbarsherlock</artifactId>
<version>4.2.0</version>
<type>apklib</type>
</dependency>
</dependencies>
<build>
<finalName>${project.artifactId}</finalName>
<sourceDirectory>src/main/java</sourceDirectory>
<pluginManagement>
<plugins>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<version>3.1.1</version>
<extensions>true</extensions>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<configuration>
<sdk>
<platform>16</platform>
</sdk>
</configuration>
</plugin>
</plugins>
</build>
</project>
Now in my Android project i have added an external project, that is not maven based. now when i execute mvn3 install i get a
Failed to execute goal
com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.1.1:generate-sources
(default-generate-sources) MojoExecutionException: ANDROID-040-001: Could not execute: Command = /bin/sh -c etc.
Now i run the above command in my command line and its complaining that the it cannot find attributes belonging to my external project. What can i do ?

Categories

Resources