美文网首页
maven+eclipse报错解决

maven+eclipse报错解决

作者: 小王www | 来源:发表于2018-01-16 18:01 被阅读0次

    Run As Maven test时
    1.提示deploy, compiler等错误,

    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

    是因为仓库中的版本不正确或以前下载出错,删除仓库中此文件夹,重新Maven->update project
    C:\Users{username}.m2\repository\org\apache\maven\plugins

    2.提示jre/../tools.jar不存在,修改项目的默认jre路径为/jdk/jre/


    修改为jdk下的jre
    image.png

    3.提示org.junit不存在


    image.png

    eclipse默认工程3.8.1,修改pom.xml文件为4.11


    mvn test 成功

    mven test成功后,run as testng 通过


    image.png

    可在testng.xml中配置需执行的测试方法

    相关文章

      网友评论

          本文标题:maven+eclipse报错解决

          本文链接:https://www.haomeiwen.com/subject/xzceoxtx.html