gpt4 book ai didi

android - 如何在 Eclipse 中安装 m2e-android-plugin?

转载 作者:塔克拉玛干 更新时间:2023-11-02 09:05:37 24 4
gpt4 key购买 nike

我正在尝试设置以在 Eclipse 中为我的 Android 项目使用 Maven 和 pom.xml 文件。我安装了 Eclipse Indigo(包括 m2e),安装了 Android SDK,安装了 ADT。我正在努力理解“安装 m2e-android-plugin”的含义(我总是被带到 this page,它提供了安装说明,但我无法遵循)具体来说,当我通过说明进行操作时页面,在我完成第 2 部分中的所有步骤后,我的结构没有“Maven Dependencies”并且我的 pom.xml 文件显示以下错误:

Project build error: Unresolveable build extension: Plugin
com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.1.1 or one of its dependencies could
not be resolved: The following artifacts could not be resolved:
com.jayway.maven.plugins.android.generation2:android-maven-plugin:jar:3.1.1,
com.android.ddmlib:ddmlib:jar:r16, org.sonatype.sisu:sisu-inject-bean:jar:2.1.1,
org.sonatype.sisu:sisu-guice:jar:no_aop:2.9.4, org.codehaus.plexus:plexus- archiver:jar:2.0.1, junit:junit:jar:3.8.1,
org.codehaus.plexus:plexus-io:jar:2.0.1, org.codehaus.plexus:plexus-utils:jar:3.0, commons-jxpath:commons-
jxpath:jar:1.3, commons-io:commons-io:jar:2.0.1, org.ow2.asm:asm:jar:4.0, commons-lang:commons-lang:jar:
2.6, org.sonatype.aether:aether-util:jar:1.12: Failure to transfer
com.jayway.maven.plugins.android.generation2:android-maven-plugin:jar:3.1.1 from http://repo1.maven.org/
maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central
has elapsed or updates are forced. Original error: Could not transfer artifact
com.jayway.maven.plugins.android.generation2:android-maven-plugin:jar:3.1.1 from/to central (http://
repo1.maven.org/maven2): No response received after 60000

连同:

Project build error: Unknown packaging: apk

在线

<packaging>apk</packaging>

最佳答案

我已经尝试自己设置一个新的第二个 IDE,并且一切都按预期工作,假设您已经正确安装了 Android SDK 和 Maven(最好使用最新版本),这些是使用 Mavenized Android 项目所需的唯一 Eclipse 插件:

  • 广告
  • m2e
  • m2e-android

查看我的屏幕截图帮助 -> 安装新软件... -> 已安装的内容:

enter image description here

如果您按照 this page 中的说明进行操作从一个新项目开始, 错误很可能是由于 maven-release-plugin 的早期版本(如果您没有明确指定)。通过将鼠标悬停在 pom.xml 中的 元素上,您应该会得到如下提示:

maven-resources-plugin prior to 2.4 is not supported by m2e. Use maven-resources-plugin version 2.4 or later.

下添加如下插件:

<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.5</version>
</plugin>

然后右键单击新项目并选择 Maven -> 更新项目配置,这应该会修复所有错误并为您提供一个工作示例。

关于android - 如何在 Eclipse 中安装 m2e-android-plugin?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11023252/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com