The maven project of idea2020.1 version reports that the package does not exist, and the package cannot be found error

wrong description

  Idea creates a maven project and imports dependencies are all successful, but it will report an error that the corresponding jar package cannot be found.
Insert picture description here

Solution:

  File -> Settings -> Search for maven -> expand maven -> Runner -> check Delegate IDE build/run actions to Maven.
After checking, the project can be run.
Check: Delegate IDE build/run actions to Maven to build IDE /Run operation delegated to Maven
Insert picture description here

Summary (this method will perform two operations)

  • The maven project needs to check the Delegate IDE build/run actions to Maven option of Runner under the manven of Settings, and delegate the IDE build/run actions to Maven, otherwise it will report the jar package not found error.
  • But when I checked Run, I found that both idea's build and maven's build seemed to be executed twice, especially when I added data, the data was saved to the database twice, and the add method was executed twice, because Both idea and maven were executed, which resulted in the addition of two identical statements .
  • I don’t know how to solve it for the time being. The IDEA version of 2019.3 did not have this situation before. This problem occurs in the 2020.1 used now. When you find a solution, you can modify it, otherwise you may only change to the idea version.

Guess you like

Origin blog.csdn.net/qq_40542534/article/details/108761024