Solve the problem of maven dependency reporting red in IDEA

1. Problem description

When using IDEA for programming, I found that there are many red flags in maven dependencies, as shown in the figure below:
insert image description here
Although it does not affect the project operation, it is indeed a problem

Reason: The main reason for this phenomenon is 由于网络原因导致没有将Maven的依赖下载完整that there are many .lastUpdatedfiles ending with

Two, the solution

Delete all the files ending with .lastUpdate in the maven warehouse, and re-download them as follows in the idea, the dependency will not be reported red

(1) Switch to maven's local warehouse

(2) Open the cmd command line in the current directory

(3) Execute the command:for /r %i in (*.lastUpdated) do del %i

insert image description here
(4) Re-download the dependency in the idea, and it will not report red
insert image description here

Guess you like

Origin blog.csdn.net/weixin_43520450/article/details/129415799