有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

Sprint工具套件上的java未解决Maven依赖

我正在尝试开始使用Spring,但我甚至无法使入门项目正常工作。看来我的配置有点问题,也许吧?我安装了Spring网站上写的所有要求

我将上传一个截图和错误

CoreException: Could not calculate build plan: Plugin org.apache.maven.plugins:maven-compiler-plugin:3.1 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-compiler-plugin:jar:3.1: ArtifactResolutionException: Failure to transfer org.apache.maven.plugins:maven-compiler-plugin:pom:3.1 from https://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.plugins:maven-compiler-plugin:pom:3.1 from/to central (https://repo.maven.apache.org/maven2): Connect to repo.maven.apache.org:443 [repo.maven.apache.org/151.101.36.215] failed: Connection timed out: connect

Spring Tool Suite


共 (1) 个答案

  1. # 1 楼答案

    Maven repo有时难以响应下载请求

    这通常说明:

    Connect to repo.maven.apache.org:443 [repo.maven.apache.org/151.101.36.215] failed: Connection timed out: connect

    然而,即使到目前为止,该网站也会运行良好,这阻碍了插件的下载:

    resolution will not be reattempted until the update interval of central has elapsed or updates are forced

    因此,如果this link正在工作,但错误仍然存在,请删除包含插件的本地目录:

    ${home}/.m2/repository/org/apache/maven/plugins/maven-compiler-plugin/3.1
    

    然后再试一次

    您还可以通过添加以下内容来尝试使用最新的maven-compiler-plugin

    <plugins>
        ...
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.7.0</version>
        </plugin>
        ...