一聚教程网:一个值得你收藏的教程网站

最新下载

热门教程

在eclipse中使用maven构建Web项目时报错:maven-resources-plugin 解决方法

时间:2015-06-27 编辑:简简单单 来源:一聚教程网


今天在一个新建的web项目中发生了以下错误:

Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin


Eclipse的错误提示如下:

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
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
一开始以为是版本问题,因为看到eclipse内嵌有maven,而我自己系统也装了maven,所以改了ecplise里的maven home设置,错误依旧;

在baidu中搜了一下(老样子,除了你不想找的,很难找到你想找的技术资料,纯属发牢骚~哈哈);

baidu找到的资料:

1,可能是网络被墙,设置镜像;

2,可以试试重新下载maven-resources-plugin;

经过尝试1,没解决问题(甚至不小心增加了问题,这个怪我自己不够细心啦,可能复制的镜像配置里有非法字符),2,我下了旧一点的版本了,问题依旧;

问题解决的场景有点意向不到(其实很多问题最初解决场景都是意向不到的,hoho~),我直接在命令行打mvn compile,提示了与eclipse不一样的错误:

[ERROR] Error executing Maven.
[ERROR] 1 problem was encountered while building the effective settings
[FATAL] Non-parseable settings /usr/share/maven/conf/settings.xml: in comment after two dashes (--) next character must be > not   (position: START_TAG seen ...\n          
 
  nexus-osc
  *
  Nexus osc
  http://maven.oschina.net/content/groups/public/



  jdk-1.4
 
  1.4
 

 
   
      nexus
      local private nexus
      http://maven.oschina.net/content/groups/public/
     
        true
     

     
        false
     

   

 

 
   
      nexus
      local private nexus
      http://maven.oschina.net/content/groups/public/
     
        true
     

     
        false
     

   

 

maven项目建立pom.xml报无法解析org.apache.maven.plugins:maven-resources-plugin:2.4.3


一、发现问题
建立maven项目后,pom.xml在显示红叉,鼠标放上去,显示Execution default-testResources of goal org.apache.maven.plugins:maven-resources-plugin:2.4.3错误。

二、原因分析
缺少maven-resources-plugin-2.4.3.jar或该文件下载不正确,可到repository\org\apache\maven\plugins\maven-resources-plugin\目录看看下载是否正确。或删除该文件重新下载。
 
三、解决办法
步骤一:
pom.xml文件加入

    org.apache.maven.plugins
    maven-resources-plugin
    2.4.3

步骤二:run as —> maven install下载即可

热门栏目