eclipse加载maven工程提示pom.xml无法解析

在别的机子上创建一个maven工程,复制到本机上导入,出现pom.xml文件错误,提示错误如下

Multiple annotations found at this line:
- Execution default-testResources of goal org.apache.maven.plugins:maven-resources-          plugin:2.4.3:testResources failed:
 Plugin org.apache.maven.plugins:maven-resources-plugin:2.4.3 or one of its dependencies could not be resolved: Failed to collect
 dependencies for org.apache.maven.plugins:maven-resources-plugin:jar:2.4.3 () (org.apache.maven.plugins:maven-resources-
 plugin:2.4.3:testResources:default-testResources:process-test-resources)
- Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile
 (execution: default-compile, phase: compile)
- CoreException: Could not get the value for parameter compilerId for plugin execution default-compile:
 PluginResolutionException: Plugin org.apache.maven.plugins:maven-compiler-plugin:2.3.2 or one of its dependencies could not be
 resolved: Failed to collect dependencies for org.apache.maven.plugins:maven-compiler-plugin:jar:2.3.2 ():
 ArtifactDescriptorException: Failed to read artifact descriptor for org.apache.maven:maven-plugin-api:jar:2.0.6:
 ArtifactResolutionException: Failure to transfer org.apache.maven:maven-plugin-api:pom:2.0.6 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 org.apache.maven:maven-plugin-api:pom:2.0.6 from/to central (http://
 repo1.maven.org/maven2): null to http://repo1.maven.org/maven2/org/apache/maven/maven-plugin-api/2.0.6/maven-plugin-
 api-2.0.6.pom
- CoreException: Could not get the value for parameter compilerId for plugin execution default-testCompile:
 PluginResolutionException: Plugin org.apache.maven.plugins:maven-compiler-plugin:2.3.2 or one of its dependencies could not be
 resolved: Failed to collect dependencies for org.apache.maven.plugins:maven-compiler-plugin:jar:2.3.2 ():
 ArtifactDescriptorException: Failed to read artifact descriptor for org.apache.maven:maven-plugin-api:jar:2.0.6:
 ArtifactResolutionException: Failure to transfer org.apache.maven:maven-plugin-api:pom:2.0.6 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 org.apache.maven:maven-plugin-api:pom:2.0.6 from/to central (http://
 repo1.maven.org/maven2): null to http://repo1.maven.org/maven2/org/apache/maven/maven-plugin-api/2.0.6/maven-plugin-
 api-2.0.6.pom
- Execution default-resources of goal org.apache.maven.plugins:maven-resources-plugin:2.4.3:resources failed: Plugin
 org.apache.maven.plugins:maven-resources-plugin:2.4.3 or one of its dependencies could not be resolved: Failed to collect
 dependencies for org.apache.maven.plugins:maven-resources-plugin:jar:2.4.3 () (org.apache.maven.plugins:maven-resources-
 plugin:2.4.3:resources:default-resources:process-resources)
- Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-plugin:
 2.3.2:testCompile (execution: default-testCompile, phase: test-compile)

错误信息出现在pom头的project标签,project标签内容是

<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">

原因

这是由于缺少maven-resources-plugin-2.4.3.jar文件。这个文件是在{user.home}\.m2\repository\org\apache\maven\plugins\maven-resources-plugin\下。{user.home}是maven的配置路径,一般是我的文档,是window-preferences-MyEclipse-Maven4MyEclipse-User
Setting里面的Local Repository。

解决方案

1、在pom.xml文件中加入maven-resources-plugin配置

<dependency><groupId></groupId><artifactId></artifactId><version></version></dependency>

2、在命令行下运行mvn install ,如果执行正确应该会在{user.home}\.m2\repository\org\apache\maven\plugins\maven-resources-plugin\下看到maven-resources-plugin-2.4.3.jar文件

3、刷新工程(右键工程选择刷新项)

4、刷新maven配置,右键工程节点,选择Maven4MyEclipse-Update Project Configuration

时间: 2024-10-02 22:29:24

eclipse加载maven工程提示pom.xml无法解析的相关文章

报错: eclipse加载maven工程提示pom.xml无法解析org.apache.maven.plugins:maven-resources-plugin:2.3.2

错误信息出现在pom头的project标签,project标签内容是 <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_

eclipse加载maven工程提示pom.xml无法解析org.apache.maven.plugins:maven-resources-plugin:2.4.3解决方案

pom文件提示信息: Failure to transfer org.apache.maven.plugins:maven-resources-plugin:pom:2.4.3 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 upd

新建maven工程时pom.xml报错

新建maven工程时,pom.xml报错:第一行报如下错误:multiple annotations found at this line后添加org.eclipse.m2e相关的plugin配置后,错误消失,完整pom.xml如下: <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schem

maven工程配置pom.xml实现mybatis的访问数据库操作

pom.xml配置: pom.xml 这个配置还有不足请在下方给出建议 I:  我这里测试三个 : 分别是有@的 DemoMapper(接口): IDemoMapper.interface package com.test; import com.pojo.Demo; import org.apache.ibatis.annotations.Select; import java.util.List; public interface DemoMapper { /** * 查询数量 count(

Maven---&gt;学习心得---&gt;maven的配置文件pom.xml

1.概述: maven就是通过其配置文件pom.xml来管理jar包的,所以了解pom.xml文件结构是十分必要的,本文讲述pom.xml相关知识. 2.参考资料: 1)maven官网documentation,POM(英文文档) 该网址上documentation讲述了如下内容 What is a POM? Super POM父pom.xml,你创建的maven工程的pom.xml实际上会自动继承Super POM.xml,也就是自动继承了SuperPOM.xml中定义的默认配置信息 Mini

seajs加载jquery时提示$ is not a function该怎么解决

这篇文章主要介绍了seajs加载jquery时提示$ is not a function该怎么解决的相关资料,需要的朋友可以参考下 jquery1.7以上的都支持模块化加载,只是jquery默认的是支持amd,不支持cmd.所以要用seajs加载jquery时,我们需要稍微做下改动,需要把以下内容做下修改,具体修改方式如下: 把 ? 1 2 3 4 5 if (typeof define === "function" && (define.amd)) {   defin

通过eclipse.ini修改Eclipse加载jdk的路径

这里直接把在网上的找到的答案记录下来,原文地址:http://www.oschina.net/question/109676_15561: 如果出现 启动 Eclipse 弹出“Failed to load the JNI shared library jvm.dll”错误, 原因1:给定目录下jvm.dll不存在. 解决方法:(1)重新安装jre或者jdk并配置好环境变量.(2)copy一个jvm.dll放在该目录下. 原因2:eclipse的版本与jre或者jdk版本不一致 解决方法:要么两

取消IE禁用加载项的提示的方法

关于加载项需要的加载时间,我们可以在Internet选项的程序选项卡中,点击“管理加载项”进行查看,禁用需要时间长的加载项.这里面,加载控件所使用的时间是我们无法控制的. 1.我们也可以通过注册表修改这个标准时间,以减少加载项提示通知,或者直接让它不再出现(把标准时间调的足够大).请在开始菜单的搜索框中输入regedit并点击回车打开注册表编辑器.定位到下面的项:/HKEY_CURRENT_USER/Software/Microsoft/Internet Explorer/MAO Setting

Maven的项目pom.xml文件配置标签列表

maven项目的pom.xml文件配置项目众多,以下是可以配置的标签 <groupId>组织id <artifactId>构件id <version>版本号 <packaging>包类型 <name>名称 <url> ??? <description>描述文本 <developers>开发者信息 <properties>属性配置信息 <build>构件配置信息 <dependenc