将Maven项目导入Eclipse并修复错误

将Maven项目导入Eclipse并修复错误

本文介绍了将Maven项目导入Eclipse并修复错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我导入了一个要蚀的项目而且我每个类名都有很多错误,即使是像String这样的类……

I made imported a project to eclipseand I have a lot of errors in every class name even classes like String ...

我做的类中的错误是 Implicit超级构造函数Object()未为默认构造函数定义.必须定义一个显式构造函数

以及方法< Class>中;无法解析为类型即使是IOException,我也无法将 IOException解析为类型

and inside the methods <Class> cannot be resolved to a typeeven to IOException I am getting IOException cannot be resolved to a type

那我该怎么办?我试图建立,不用再打扫

so what should I do ?I tried to build , clean again with no use

更新:我也正在获得说明

UPDATE : also I am getting Description

Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-resources-plugin:2.4.3:resources (execution: default-resources, phase: process-resources)   pom.xml /test line 6    Maven Project Build Lifecycle Mapping Problem

推荐答案

您导入的项目是Maven项目.您应该做的是打开位于项目根目录中的pom.xml文件,并在文件的插件管理部分中添加以下插件:

The project that you imported is a Maven project. What you should do is open the pom.xml file located in the root of the project and add the following plugin in the plugin management part of the file:

<build>
    <pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.eclipse.m2e</groupId>
                <artifactId>lifecycle-mapping</artifactId>
                <version>1.0.0</version>
                <configuration>
                    <lifecycleMappingMetadata>
                        <pluginExecutions>
                            <pluginExecution>
                                <pluginExecutionFilter>
                                    <groupId>org.apache.maven.plugins</groupId>
                                    <artifactId>maven-resources-plugin</artifactId>
                                    <versionRange>[2.0,)</versionRange>
                                    <goals>
                                        <goal>resources</goal>
                                        <goal>testResources</goal>
                                    </goals>
                                </pluginExecutionFilter>
                                <action>
                                    <ignore />
                                </action>
                            </pluginExecution>
                        </pluginExecutions>
                    </lifecycleMappingMetadata>
                </configuration>
            </plugin>
        </plugins>
    </pluginManagement>
</build>

然后右键单击该项目,转到Maven并更新项目配置.

Then right click the project, go to Maven and Update project configuration.

这应该解决它.

这篇关于将Maven项目导入Eclipse并修复错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-06 08:20