我正在尝试开始使用 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
最佳答案
Maven 存储库有时难以响应下载请求。
这通常表明:
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>
...
关于java - Spring Tool Suite 中 Unresolved Maven 依赖关系,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48874518/