"spring-boot-starter-web" and other red reports

"spring-boot-starter-web", "spring-boot-starter-test", "spring-boot-maven-plugin" and other red-reported issues

When I first created the springboot project, I encountered the above problem. After reading many blogs, I found a solution.

Determine the source of the problem

In maven's local warehouse, I checked the path org/springframework/boot (that is <groupId>org.springframework.boot</groupId>) and found that there are no these folders under the file.

<dependency>
       <groupId>org.springframework.boot</groupId>
       <artifactId>spring-boot-starter-web</artifactId>
       <version>3.0.2</version>
</dependency>

Insert image description here

So, the cause of the problem:

1. Maven is not refreshed
2. The plug-in download speed is too slow, that is, it is downloaded from a foreign central warehouse.

Solution

Open the settings.xml file in your maven address, add the following content in the mirrors tag ( note that it does not need to be overwritten!! ), save it, and then use maven to reload or generate it.

 <mirror>  
      <id>alimaven</id>  
      <name>aliyun maven</name>  
      <url>http://maven.aliyun.com/nexus/content/groups/public/</url>  
      <mirrorOf>central</mirrorOf>          
</mirror> 

Guess you like

Origin blog.csdn.net/Peanut31434331/article/details/128988246