在新建的时候console里报:18-8-20 下午05时36分57秒: Build errors for demo2; org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.0.2:resources (default-resources) on project demo2: Execution default-resources of goal org.apache.maven.plugins:maven-resources-plugin:3.0.2:resources failed: Unable to load the mojo 'resources' (or one of its required components) from the plugin 'org.apache.maven.plugins:maven-resources-plugin:3.0.2'run as maven install 报
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building demo2 Maven Webapp 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-surefire-plugin/2.20.1/maven-surefire-plugin-2.20.1.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 21.456 s
[INFO] Finished at: 2018-08-20T17:39:12+08:00
[INFO] Final Memory: 3M/6M
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin org.apache.maven.plugins:maven-surefire-plugin:2.20.1 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-surefire-plugin:jar:2.20.1: Could not transfer artifact org.apache.maven.plugins:maven-surefire-plugin:pom:2.20.1 from/to central (https://repo.maven.apache.org/maven2): Connect to repo.maven.apache.org:443 [repo.maven.apache.org/151.101.24.215] failed: Connection timed out: connect -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException

解决方案 »

  1.   

    failed: Connection timed out: connect
    连接超时。中央仓库地址换成http://repo1.maven.org/maven2或者国内的仓库地址试试
      

  2.   


    老哥 是在mirror里修改吗 没有用啊
      

  3.   


    改完以后我记得myeclipse要reindex的。
      

  4.   


    改完以后我记得myeclipse要reindex的。
    老哥 还是不行 我按照网上的教程看了一下jar包里的中央仓库地址就是http://repo1.maven.org/maven2
    后来换了阿里的还是不行啊
      

  5.   


    改完以后我记得myeclipse要reindex的。
    老哥 还是不行 我按照网上的教程看了一下jar包里的中央仓库地址就是http://repo1.maven.org/maven2
    后来换了阿里的还是不行啊按理不应该啊,你把setting.xml贴出来看下。
      

  6.   


    改完以后我记得myeclipse要reindex的。
    老哥 还是不行 我按照网上的教程看了一下jar包里的中央仓库地址就是http://repo1.maven.org/maven2
    后来换了阿里的还是不行啊按理不应该啊,你把setting.xml贴出来看下。老哥 就是这样。 
      

  7.   


    Could not transfer artifact org.apache.maven.plugins:maven-surefire-plugin:pom:2.20.1 from/to central (https://repo.maven.apache.org/maven2): Connect to repo.maven.apache.org:443 [repo.maven.apache.org/151.101.24.215] failed: Connection timed out: connect -> [Help 1]
    配置没错啊 错误的地址是这个,你有没有加载错setting文件?
      

  8.   


    老哥 我换了好多镜像
    都报Unable to update index for net-cn|http://maven.net.cn/content/groups/public/ 这个
      

  9.   

    解决eclipse安装maven的问题:Unable to update index for central|http://repo1.maven.org/maven2
      

  10.   

    解决eclipse安装maven的问题:Unable to update index for central|http://repo1.maven.org/maven2老哥 我成功了 是myeclipse的问题 可能是之前8.6的版本太低了 换了10就好了