[英]Project 'org.springframework.boot:spring-boot-starter-parent:2.4.0' not found
I am following this guide: https://spring.io/guides/gs/serving-web-content/ ,我正在关注本指南: https://spring.io/guides/gs/serving-web-content/ ,
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.4.0</version>
<relativePath/>
</parent>
<groupId>org.example</groupId>
<artifactId>plats-bruts</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
but I have this problem on the pom:但我在 pom 上有这个问题:
Project 'org.springframework.boot:spring-boot-starter-parent:2.4.0' not found
but Its here https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-parent/2.4.0但它在这里https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-parent/2.4.0
I just ran into a similar problem.我刚刚遇到了类似的问题。 I'm using IntelliJ IDEA Ultimate 2020.2.
我正在使用 IntelliJ IDEA Ultimate 2020.2。 The version number 2.4.0 was red and the message was the same as yours.
版本号 2.4.0 是红色的,消息和你的一样。
Selecting File -> Invalidate Caches / Restart... and choosing the Invalidate and Restart option fixed the issue.选择 File -> Invalidate Caches / Restart... 并选择 Invalidate and Restart 选项修复了该问题。 I guess it was just a stale cache.
我想这只是一个陈旧的缓存。
Spring Boot's starter parent pom certainly does exist in Maven Central . Spring Boot 的 starter parent pom 确实存在于 Maven Central 中。
I copied your pom.xml
and ran mvn test
using Maven 3.6.3.我复制了你的
pom.xml
并使用 Maven 3.6.3 运行了mvn test
。 All required libraries, including the parent pom were downloaded just fine.所有必需的库,包括父 pom 都下载得很好。 You will probably want to look at your
~/.m2/settings.xml
file to see if any proxies are active that are preventing you from connecting to Maven Central.您可能想要查看您的
~/.m2/settings.xml
文件,以查看是否有任何代理处于活动状态,阻止您连接到 Maven Central。
Probably you are trying to run mvn spring-boot:run
directly.可能您正在尝试直接运行
mvn spring-boot:run
。
You can use the wrapper instead cf.您可以使用包装器代替 cf。
./mvnw spring-boot:run
This should fix your problem. ./mvnw spring-boot:run
这应该可以解决您的问题。
What worked for me was re-building and remote caches and then local caches.对我有用的是重新构建和远程缓存,然后是本地缓存。 Here're the steps I followed (on Mac, please translate to your target environment):
以下是我遵循的步骤(在 Mac 上,请转换为您的目标环境):
I'm using IntelliJ IDEA Ultimate 2021.1.1.我正在使用 IntelliJ IDEA Ultimate 2021.1.1。 The version number 2.5.4 Spring Boot.
版本号 2.5.4 Spring Boot。 I just restarted Intellij and the error was fixed.
我刚刚重新启动了 Intellij,错误已修复。
Just reload your Maven project in the IDE.只需在 IDE 中重新加载您的 Maven 项目。 It will work.
它会起作用。
就我而言, mvn clean
帮助我解决了同样的问题。
Short Answer: Double check if your internet provider is blocked maven repo https://repo.maven.apache.org/maven2/ site mistakenly. Short Answer: Double check if your internet provider is blocked maven repo https://repo.maven.apache.org/maven2/ site mistakenly.
I also encounter with this problem.我也遇到这个问题。 For my case, I tried everything, like invalidate cache and restart Intellij, re-import the maven dependencies.
对于我的情况,我尝试了所有方法,例如使缓存无效并重新启动 Intellij,重新导入 maven 依赖项。 But those are not working for me.
但那些对我不起作用。
When I try to re-import the maven dependencies with my mobile data, then everything is okay.当我尝试使用我的移动数据重新导入 maven 依赖项时,一切正常。 So, there was a problem with my internet provider.
所以,我的互联网提供商有问题。
After I inform them, then I was fixed.在我通知他们之后,我就确定了。 Thanks
谢谢
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.