The error report suggested another workaround .
You can use <scope>provided</scope> , as suggested in the Spring documentation, and then go to your project settings in IntelliJ. For the module in question, on the Dependencies tab, you will see that the dependencies associated with spring-boot-starter-tomcat are listed as Provided. Changing them to Compilation should force IntelliJ to add them to the classpath.
This has the advantage of not requiring any changes to your pom.xml and allows you to use the Spring boot integration provided by IntelliJ.
Samuel B. Johnson
source share