eclipse导入Maven项目pom.xml文件报错

pom.xml头部的http://maven.apache.org/xsd/maven-4.0.0.xsd"报错。

Could not calculate build plan: Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.6

解决:

1.需要将window->preferences->Maven->User Settings中的路径进行修改,

eclipse导入Maven项目pom.xml文件报错

项目右键-> Maven 下的 Update Project 刷新一下项目

2.或者

因为各种原因(网速慢、断网)导致jar包下载不下来,出现很多.lastUpdated文件。 需要将其全部删除

首先确定你的电脑连接网络,在maven的本地库的路径下执行以下命令: for /r %i in (*.lastUpdated) do del %i

然后尝试刷新maven工程,

右键maven工程,maven->update 刷新一下看是否可以成功。

3.报错No plugin found for prefix ‘war’ in the current project and in the plugin groups

解决:

在pom.xml文件中,添加

         <dependency>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-resources-plugin</artifactId>
            <version>2.5</version>
        </dependency>