首页 > 解决方案 > Intellij 使用 java 创建示例 struts web 项目,然后显示此错误

问题描述

无法下载' http://central.maven.org/maven2/org/apache/struts/struts2-core/2.5.14.1/struts2-core-2.5.14.1.jar':central.maven.org

标签: intellij-ideastruts2

解决方案


如果您的 pom.xml 中有 Maven 中央存储库的 URL,定义如下:

    <repository>
        <id>Maven Central</id>
        <name>Maven Central Repository</name>
        <url>http://central.maven.org/maven2</url>
    </repository>

然后 url 需要更新,以

    <repository>
        <id>Maven Central</id>
        <name>Maven Central Repository</name>
        <url>https://repo1.maven.org/maven2</url>
    </repository>

因为:“从 2020 年 1 月 15 日开始,中央存储库将不再支持通过 HTTP 进行的通信”(https://blog.sonatype.com/central-repository-moving-to-https


推荐阅读