java - Spring Tool Suite 中 Unresolved Maven 依赖关系

标签 java spring 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

最佳答案

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/

相关文章:

java - 如何编译具有Weblogic依赖项的Web项目

java - 为什么 Sonar 只分析pom.xml?

eclipse - 类路径条目 org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER 将不会被导出

java - 如何在方解石中将项目、过滤器、聚合下推到 TableScan

java - Ebean @ManyToOne,查找器不检索相关对象的所有数据

java - 如何根据输入值动态注入(inject)或获取bean?

spring - 如何使用spring data jpa获取表的列名

java - 如何创建Maven依赖bat文件?

java - Infinispan反序列化白名单: Class '[I'

java - 覆盖 Pageable findAll 以在 Spring Data Rest 中选择更少的列