Solution of maven pom.xml dependency invalidation in IntelliJ

https://blog.csdn.net/weixin_33400820/article/details/78855594?utm_medium=distribute.pc_relevant.none-task-blog-baidujs_title-0&spm=1001.2101.3001.4242

The Maven project was created in IntelliJ, and the dependencies of slf4j and log4j were added to pom.xml. However, when writing the program, we found that IntelliJ had no text assistance about slf4j and log4j at all. After checking, we found that although the dependencies in pom.xml had been downloaded to the local repository, they were not added to the extended libraries of the project path
as shown in the figure:

After Google and Baidu, they didn’t find the same type of problems, so they had to explore their own solutions. They found that there was a management window for Maven project in IntelliJ

View –> Tool Windows –> Maven Projects

If the dependencies folder is not found, there is no dependency in the project, but the content required for dependency has been added to the pom.xml file. Later, it is found that the content of Maven’s pom.xml file needs to be re imported, as shown in the figure:

Re import can find all the dependent packages in external libraries

Read More: