eclipse com.jayway.maven.plugins.android.generation2:生命周期配置未涵盖插件执行?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/13554694/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 19:28:52  来源:igfitidea点击:

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

androideclipsemavenandroid-maven-plugin

提问by ColonelPackage

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.

我难住了。我们最近将我们的 Android 项目转换为 Maven 项目。我的合作伙伴正在使用 IntelliJ,而我正在使用 Eclipse。他说这对他的设置很好。

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

我对 Maven 非常陌生,并遵循了教程并阅读了我能找到的几乎所有内容来尝试解决此问题。

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

我的 pom.xml 文件中有以下错误:

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

这是我的 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?

我错过了什么?

回答by Clint Eastwood

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.

发生这种情况是因为 Eclipse (m2e) 的 Maven 插件,默认情况下,知道在常规插件执行(编译、测试、处理资源等)上该做什么,但它不知道对这些 Android“做什么”插件执行。

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.

有时,例如在配置 maven-war-plugin、maven-ear-plugin 等时,您可以通过从 Eclipse Marketplace 下载所谓的“m2e-connectors”来增强 m2e 提供的基本功能。在那之后,m2e 知道如何处理一些“非标准”插件执行并停止显示这些错误。

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

在这种特殊情况下(Android 插件),您很幸运,可以安装连接器来解决问题。

option 1: (simpler)

选项1:(更简单)

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

转到 Eclipse Marketplace 并查找“Android Configurator for M2E”并安装它。

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:

如果由于某种原因您无法使用/访问市场(例如,如果您使用的是 Spring Tool Suite -STS-),您仍然可以安装连接器:

option 2:

选项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.

并按 ENTER。它将弹出一个确认对话框,再次按 ENTER,您应该能够看到该更新站点上可用的软件。只需勾选所有这些(“NDK 插件”是唯一可选的),就是这样,在完全重建之后,您的问题应该消失了。

Hope this helps.

希望这可以帮助。