eclipse maven 无法下载jar包,但仓库url在浏览器可正常访问

yiguanqinshou123 2018-02-08 07:28:50
执行install命令,输出信息如下

[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
...全文
1554 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
oO临时工Oo 2018-02-26
  • 打赏
  • 举报
回复
~~~~~~~~~~~~~~~Test CSDN BUG~~~~~~~~~~~~~~~~~~~~~~~~
maradona1984 2018-02-09
  • 打赏
  • 举报
回复
建议检查下pom.xml是不是配了其他仓库
oO临时工Oo 2018-02-09
  • 打赏
  • 举报
回复
在maven的setting.xml中,配置mirror。排在第一个的mirror优先

<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
    <mirrors>
        <!-- 阿里云仓库 -->
        <mirror>
            <id>alimaven</id>
            <mirrorOf>central</mirrorOf>
            <name>aliyun maven</name>
            <url>http://maven.aliyun.com/nexus/content/repositories/central/</url>
        </mirror>
    
        <!-- 中央仓库1 -->
        <mirror>
            <id>repo1</id>
            <mirrorOf>central</mirrorOf>
            <name>Human Readable Name for this Mirror.</name>
            <url>http://repo1.maven.org/maven2/</url>
        </mirror>
    
        <!-- 中央仓库2 -->
        <mirror>
            <id>repo2</id>
            <mirrorOf>central</mirrorOf>
            <name>Human Readable Name for this Mirror.</name>
            <url>http://repo2.maven.org/maven2/</url>
        </mirror>
    </mirrors> 
</settings>

58,454

社区成员

发帖
与我相关
我的任务
社区描述
Java Eclipse
社区管理员
  • Eclipse
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧