org.apache.maven.surefire 无法引用或无法下载问题

来源:互联网 发布:穿越火线挂机软件 编辑:程序博客网 时间:2024/06/05 04:17

问题报错:

Failure to transfer org.apache.maven.surefire:surefire:pom:2.10 from http://repo.maven.apache.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.surefire:surefire:pom:2.10 from/to central (http://repo.maven.apache.org/maven2): java.net.ConnectException:

connection timed out to http://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire/2.10/surefire-2.10.pom


错误原因:

org.apache.maven.surefire    没有配置    和 http://repo.maven.apache.org/maven2  连接不上的问题


解决方式:

   在pom.xml文件中 注意配置如下内容:

       <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.7</version>
            </plugin>
     </plugins>


   其次 如果还报 connection timed out ,请再setting.xml添加仓储镜像解决,比如使用阿里云的仓储镜像速度非常快,配置如下:
<mirrors>
    <mirror>
      <id>alimaven</id>
      <name>aliyun maven</name>
      <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
      <mirrorOf>central</mirrorOf>        
    </mirror>
  </mirrors>


0 0
原创粉丝点击