Error in maven pom xml file: creating Android project

I get an error in the plugin tag in the pom xml file. The error is indicated on the plugin tag before groupId.

Error : -

Plugin execution not covered by lifecycle configuration:com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.8.2:consume-aar (execution: default-consume-aar, phase: compile) 

Anyone knows how to solve this problem. Below is the contents of the pom.xml file

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.simpligility.android</groupId> <artifactId>helloflashlight</artifactId> <version>1.0.0</version> <packaging>apk</packaging> <name>HelloFlashlight</name> <dependencies> <dependency> <groupId>com.google.android</groupId> <artifactId>android</artifactId> <version>4.1.1.4</version> <scope>provided</scope> </dependency> </dependencies> <build> <sourceDirectory>src</sourceDirectory> <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 as api level (api level 16 = platform 4.1)--> <platform>16</platform> </sdk> </configuration> </plugin> </plugins> </build> </project> 
+8
java android xml maven
Jan 09 '14 at 9:28
source share
5 answers

To drown out the error in pom.xml, you can add the following:

  <pluginManagement> <plugins> <plugin> <groupId>org.eclipse.m2e</groupId> <artifactId>lifecycle-mapping</artifactId> <version>1.0.0</version> <configuration> <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 /> </pluginExecution> </action> </pluginExecutions> </lifecycleMappingMetadata> </configuration> </plugin> . . . 
+5
May 4 '14 at 5:52
source share

This is due to the new m2eclipse plugin that has recently appeared.

For all build execution specified in your pom.xml, if the m2eclipse plugin has the corresponding configuration information in the lifecycle-mapping-metadata.xml file, it shows this error.

You can get more information here.

You can ignore this error, which does not affect the execution of your project.

+2
Jan 09 '14 at 9:41
source share

Eclipse M2E warns you that your life cycle contains an unknown plugin. M2E cannot decide whether it is irrelevant and can be ignored or is an integral part of your life cycle.

This information can be provided as an entry in your pom.xml in a special life cycle for your eclipse or by installing a special configuration plugin, which is usually the best solution.

In your case, there is a configurator plugin for the android-maven-plugin module, look at: http://rgladwell.imtqy.com/m2e-android/ , which should solve your problem rather accurately.

+1
Jan 09 '14 at 9:39 on
source share

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.

+1
May 17 '14 at 23:03
source share

From Maven Eclipse (m2e) version 0.12, all Maven life cycle goals must be mapped to the installed m2e extension. In this case, android-maven-plugin added a new consume-aar to support the new Android library archive format.

The Android for Maven Eclipse (m2e-android) plugin does not yet support AAR (since Google did not add AAR support for ADT but), therefore this target is not displayed, and that is why you get this error message.

You can exclude non-lifecycle goals by simply following the instructions here:

https://wiki.eclipse.org/M2E_plugin_execution_not_covered

Alternatively, simply right-click the error message in Eclipse and select Quick Fix Ignore for every pom with such errors .

+1
Jun 21 '14 at 11:09
source share



All Articles