com.jayway.maven.plugins.android.generation2: Plugin execution not covered by lifecycle configuration?
Asked Answered
E

1

20

I'm stumped. We recently converted our Android project to a Maven project. My partner is using IntelliJ and I'm using Eclipse. He says this builds fine with his setup.

I'm very new to Maven and have followed the tutorials and read just about everything I can find to try to resolve this.

I have the following error in my pom.xml file:

Multiple annotations found at this line:
- Plugin execution not covered by lifecycle configuration: com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.3.2:proguard (execution: default-proguard, 
 phase: process-classes)
- Plugin execution not covered by lifecycle configuration: com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.3.2:generate-sources (execution: default-
 generate-sources, phase: generate-sources)

Here's my 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>com.groupmd.clientandroid</groupId>
<artifactId>clientandroid</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>apk</packaging>
<name>GroupMD</name>

<dependencies>
    <dependency>
        <groupId>com.google.android</groupId>
        <artifactId>support-v4</artifactId>
        <version>r7</version>
    </dependency>
    <dependency>
        <groupId>com.google.code.gson</groupId>
        <artifactId>gson</artifactId>
        <version>2.2.2</version>
        <scope>compile</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</sourceDirectory>
    <pluginManagement>
        <plugins>
            <plugin>
                <groupId>com.jayway.maven.plugins.android.generation2</groupId>
                <artifactId>android-maven-plugin</artifactId>
                <version>3.3.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 or api level (api level 4 = platform 1.6)-->
                    <platform>14</platform>
                </sdk>
            </configuration>
        </plugin>
    </plugins>
</build>
</project>

What am I missing?

Ellswerth answered 25/11, 2012 at 19:37 Comment(5)
Just to follow-up on my post, I've downloaded the samples from: code.google.com/p/maven-android-plugin/wiki/Samples and I can build the flaslight sample fine with 'mvn install' so I think it has to be something specific to my Eclipse Maven plugin. No?Ellswerth
When I try mvn install from the command line for the problem project, I'm seeing a ton of errors of the form: [ERROR] /home/mhoyt/workspace/client-android/target/unpack/apklibs/com.actionbarsherlock_actionbarsherlock_apklib_4.2.0/src/com/ac tionbarsherlock/app/SherlockFragmentActivity.java:[3,27] package android.content.res does not exist Not sure if this is related to the pom.xml file error but it doesn't seem as if the one "ActionBarSherlock" dependency is getting downloaded either.Ellswerth
Which version of the m2e-android plugin do you have installed? This was a problem with an old version? Also apklib for ABS is not yet supported by m2e-android.Whoredom
I'm not sure which version it is. I'm assuming, based on the error that I'm getting, it's 3.3.2. If I got to Help->About Eclipse and select the Eclipse.org m2e plugin it shows: Version = 1.2.0.20120903-1050.Ellswerth
I uninstalled and then re-installed the same plugin and the error regarding "Plugin not covered by lifecycle..." is gone now. Pretty strange... Thanks for the comment on ABS apklib. The last comments I could find were from Aug/Sep so I was holding out hope that that problem may have been resolved.Ellswerth
B
42

This happens because the Maven plugin for Eclipse (m2e), by default, knows what to do on the regular plugin executions (compile, test, process-resources, etc.) but it doesn't know "what to do" with these Android plugin executions.

Sometimes, for example when configuring maven-war-plugin, maven-ear-plugin, etc., you can enhance the basic functionality provided by m2e, by downloading the so-called "m2e-connectors" from the Eclipse Marketplace. After that, m2e knows what to do on some "non-standard" plugin executions and stops showing these errors.

In this particular case (Android plugins) you are lucky and there are connectors to be installed for fixing the problem.

option 1: (simpler)

Go to the Eclipse Marketplace and look for "Android Configurator for M2E" and install it.

If, for some reason, you cannot use/access the Marketplace (e.g. if you are using Spring Tool Suite -STS-) you can still install the connector:

option 2:

Help --> Install New Software... --> Work with and paste the following (exactly as it is, without ommiting anything)

Maven Integration for Android Development Tools Dependency Sites - http://rgladwell.github.com/m2e-android/updates/

and press ENTER. It will pop up a confirmation dialog, press ENTER again and you should be able to see the software available at that update site. Just tick all of them ("NDK plugins" is the only optional) and that's it, after a full rebuild, your problems should be gone.

Hope this helps.

Bushelman answered 7/5, 2013 at 19:21 Comment(2)
Great! This is what I was looking for - other answers to the same problem yielded complex workarounds for a problem that wasn't therePhoton
What to do with android-maven-plugin 3.9.0-rc.2 with Eclipse 4.4RC4? See https://mcmap.net/q/662579/-android-maven-plugin-3-8-2-not-covered-by-lifecycle . Any ideas?Odonto

© 2022 - 2024 — McMap. All rights reserved.