To solve the problem, we must add all the following elements to pom.xml:
<plugin> <groupId>org.eclipse.m2e</groupId> <artifactId>lifecycle-mapping</artifactId> <version>1.0.0</version> </plugin>
Here is the final 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>testMyc</groupId> <artifactId>srgfrzfd</artifactId> <version>0.0.1-SNAPSHOT</version> <packaging>apk</packaging> <name>srgfrzfd</name> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <platform.version> 4.1.1.4 </platform.version> <android.plugin.version>3.8.2</android.plugin.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>${android.plugin.version}</version> <extensions>true</extensions> </plugin> </plugins> <plugin> <groupId>org.eclipse.m2e</groupId> <artifactId>lifecycle-mapping</artifactId> <version>1.0.0</version> </plugin> </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>
and the next tag in the file "lifecycle-mapping-metadata.xml", which is located in the life cycle mapping "Windows"> and preferably maven> "Open workspace life cycle display metadata" eclipse menu
<?xml version="1.0" encoding="UTF-8"?> <lifecycleMappingMetadata> <pluginExecutions> <pluginExecution> <pluginExecutionFilter> <groupId>com.jayway.maven.plugins.android.generation2</groupId> <artifactId>android-maven-plugin</artifactId> <versionRange>[1.0.0,)</versionRange> <goals> <goal>consume-aar</goal> </goals> </pluginExecutionFilter> <action> <ignore /> </action> </pluginExecution> </pluginExecutions> </lifecycleMappingMetadata>
Save the file in your workspace.
Answer provided by myc1986.
myc1986 May 17 '14 at 23:03 2014-05-17 23:03
source share