Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error in maven pom xml file: Building Android project [duplicate]

I am getting the error in plugin tag in pom xml file. The error is on 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)

Any one knows how to resolve this problem. Below mentioned is the pom.xml file contents

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>
like image 957
Amrit Pal Singh Avatar asked Jan 09 '14 09:01

Amrit Pal Singh


2 Answers

To silence the error in pom.xml the following could be added in there:

    <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>
       . . . 
like image 169
alexander Avatar answered Oct 05 '22 04:10

alexander


That is because of new m2eclipse plugin, a feature of it newly introduced.

For all the build executions that are specified in your pom.xml if there are respective config information in lifecycle-mapping-metadata.xml file of m2eclipse plugin, It shows that error.

You can get more info here

You can ignore that error, that doesn't effect your project execution.

like image 34
gowtham Avatar answered Oct 05 '22 02:10

gowtham