【问题标题】:Your projects contains error please fix them before running:Eclipse您的项目包含错误,请在运行前修复它们:Eclipse
【发布时间】:2014-08-20 19:44:00
【问题描述】:

我正在构建 android 应用程序,在该应用程序中,我从该链接导入了一个 maven 库https://github.com/devnied/EMV-NFC-Paycard-Enrollment.My 项目名称是 Nfcs,我在项目中没有错误,我已经成功地在我的项目中添加了所有依赖项但是当我运行项目错误窗口打开说“您的项目包含错误,请在运行前修复它们”。请帮我找出错误...

库项目的 pom.xml。

<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>
    <artifactId>library</artifactId>
    <packaging>jar</packaging>
    <name>EMV paycard library</name>

    <parent>
        <groupId>com.github.devnied.emvnfccard</groupId>
        <artifactId>parent</artifactId>
        <version>1.1.1-SNAPSHOT</version>
    </parent>

    <dependencies>
        <dependency>
            <groupId>com.github.devnied</groupId>
            <artifactId>bit-lib4j</artifactId>
        </dependency>

        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
        </dependency>

        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-collections4</artifactId>
        </dependency>

        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
        </dependency>

        <!-- Unit test -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.11</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.easytesting</groupId>
            <artifactId>fest-assert</artifactId>
            <version>1.4</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.powermock</groupId>
            <artifactId>powermock-module-junit4</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.powermock</groupId>
            <artifactId>powermock-api-easymock</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>cglib</groupId>
            <artifactId>cglib</artifactId>
            <scope>test</scope>
        </dependency>

    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>org.eluder.coveralls</groupId>
                <artifactId>coveralls-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>cobertura-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>


</project>

【问题讨论】:

  • “包资源管理器”窗口中是否有一些未用红色标记的项目?
  • 对不起,请检查我的编辑@Rems
  • 这很奇怪...如果您正在使用 Maven,您应该在某处有一个 pom.xml 文件。该文件描述了 Maven 将构建您的项目,或者基本上生成您的 .apk 。你没有那个地方吗?
  • 顺便说一句,正如我在您之前的一篇文章中告诉您的,Eclipse 不是使用 Maven 的最佳选择。但现在我有官方证据证明 Eclipse Android 插件不支持 Maven Build...检查一下:Android Studio vs. ADT comparison。检查第一个表。
  • 您是否尝试过按照错误消息提示右键单击 Maven 项目 > Maven > 更新项目?

标签: java android eclipse git maven


【解决方案1】:

你的错误信息说:

... Run Maven->Update Project or Use Quick Fix.

当您看到错误出现在您的 Maven 项目中时,您应该遵循 Eclipse 给您的提示!然后右键单击您的 Maven 项目 > Maven > 更新项目。

通常,Eclipse 提示非常有用。

阅读this post 以了解此功能的用途。您必须记住,Maven 不是 Eclipse 中的“本机”构建管理器,因此需要一些调整和额外的操作才能使其正常工作。

【讨论】:

    猜你喜欢
    • 2012-03-31
    • 2011-06-24
    • 1970-01-01
    • 1970-01-01
    • 2014-06-11
    • 2014-09-06
    • 2015-06-30
    • 2023-03-07
    • 1970-01-01
    相关资源
    最近更新 更多