maven仓库不能访问的解决办法

[INFO] Scanning for projects...
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] Building Project Maven Webapp 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] Downloading from central: https://repo.maven.apache.org/maven2/commons-dbcp/commons-dbcp/1.4/commons-dbcp-1.4.pom
[INFO] Downloading from central: https://repo.maven.apache.org/maven2/org/mybatis/mybatis-spring/1.3.0/mybatis-spring-1.3.0.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.722 s
[INFO] Finished at: 2018-02-08T19:21:46+08:00
[INFO] Final Memory: 13M/114M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project Project: Could not resolve dependencies for project com.zeng:Project:war:0.0.1-SNAPSHOT: Failed to collect dependencies at commons-dbcp:commons-dbcp:jar:1.4: Failed to read artifact descriptor for commons-dbcp:commons-dbcp:jar:1.4: Could not transfer artifact commons-dbcp:commons-dbcp:pom:1.4 from/to central (https://repo.maven.apache.org/maven2): Server sent an unsupported extension: type_35 -> [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/DependencyResolutionException

在maven的setting.xml中,配置mirror。排在第一个的mirror优先



    
        
        
            alimaven
            central
            aliyun maven
            http://maven.aliyun.com/nexus/content/repositories/central/
        
     
        
        
            repo1
            central
            Human Readable Name for this Mirror.
            http://repo1.maven.org/maven2/
        
     
        
        
            repo2
            central
            Human Readable Name for this Mirror.
            http://repo2.maven.org/maven2/
        
     

转自:https://bbs.csdn.net/topics/392320872



你可能感兴趣的:(maven)