8

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>
Amrit Pal Singh
  • 7,116
  • 7
  • 40
  • 50
  • this link might help you:http://stackoverflow.com/questions/6352208/how-to-solve-plugin-execution-not-covered-by-lifecycle-configuration-for-sprin – Charles Stevens Jan 09 '14 at 09:36
  • 1
    check this link also http://wiki.eclipse.org/M2E_plugin_execution_not_covered – Sinto Jan 09 '14 at 09:41
  • you can find solution here http://stackoverflow.com/questions/9142533/plugin-execution-not-covered-by-lifecycle-configuration-jbossas-7-ear-archetype/ – gowtham Jan 09 '14 at 09:45

5 Answers5

5

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>
       . . . 
alexander
  • 59
  • 1
  • 3
  • This is the correct way of doing it, as suggested by the docs: http://wiki.eclipse.org/M2E_plugin_execution_not_covered#ignore_plugin_goal – twig Oct 07 '14 at 22:29
2

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.

gowtham
  • 977
  • 7
  • 15
  • Hi gowtham, will you tell me how to ignore that error? – Amrit Pal Singh Jan 09 '14 at 09:55
  • @AmritPalSingh Ignore in a sense, leave that error,Dont do anything, It will show error mark(red mark) in pom.xml, but will not effect your project execution. :) – gowtham Jan 09 '14 at 09:58
  • But if I ignore that error it is giving Your project contains error(s), please fix them before running your application – Amrit Pal Singh Jan 09 '14 at 10:06
  • @AmritPalSingh - yes but they wont stop your project execution. If you don't want errors, you can go through the links provided in the comments under your question – gowtham Jan 09 '14 at 10:09
1

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

This information can either be provided as entry in your pom.xml, in a special lifecycle-file for your eclipse or by installing a specific configuration plugin, which is usually the best solution.

In your case, there exists a configurator plugin for the android-maven-plugin, take a look at: http://rgladwell.github.io/m2e-android/, which should solve your problem quite neatly.

blackbuild
  • 5,026
  • 1
  • 23
  • 35
1

To solve the problem , we must add in the pom.xml all of the following elements :

<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 following tag in the "lifecycle-mapping-metadata.xml" file that is in the "Windows" > and preferably maven > lifecycle mapping > " Open workspace lifecycle mapping 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 in use .

Answer supplied set by myc1986

Daniel
  • 10,115
  • 3
  • 44
  • 62
myc1986
  • 21
  • 1
1

As of Maven Eclipse (m2e) version 0.12 all Maven life-cycle goals must map to an installed m2e extension. In this case, the android-maven-plugin added a new goal, consume-aar to support the new Android Library archive format.

The Android for Maven Eclipse (m2e-android) plugin does not have AAR support yet (because Google have not added AAR support to the ADT yet) so this goal is unmapped and this is why you're getting this error message.

You can exclude un-mapped life-cycle goals by simply following the instructions here:

https://wiki.eclipse.org/M2E_plugin_execution_not_covered

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

Ricardo Gladwell
  • 3,770
  • 4
  • 38
  • 59