Idea create a new Spring Boot project + brief introduction to the project directory + project package and run + import Module project can not identify the problem (all reported in red or gray) solution--Rookie Xiaohui
Idea create a new Spring Boot project + brief introduction to the project directory + project package and run + import Module project can’t identify the problem (all report red or gray)
This article mainly records the first use of idea to create a Spring Boot project and common problems, suitable for beginners. Before that, eclipse was used, and the package was generally war package, and the project was deployed using external tomcat. In addition, the spring boot project has built-in tomcat, which can be directly deployed as a jar package.
Then select Modules, click web (if not, click the plus sign in the upper left corner to create a new one), then double-click the first item in the Web Resource Directory below, here is to set the path of the webapp, usually it is automatically set, directly Click ok, then click yes.
Finally, click the plus sign above to create a new web.xml
Pay attention to the path here, and put it in the webapp folder just created. Click ok, and then click ok, the web.xml is created.
At this point, the war package project is created, and the war package project can be run using external tomcat.
Three, a brief introduction to the project catalog
Fourth, the project is packaged and run
Maven on the right, find the project, install
jar package operation (the host has jdk)
java -jar 包名
//Linux中后台运行
nohup java -jar 包名 &
Run the war package (under tomcat's webapps folder)
5. Common problems for novices-After the module transfer, all items are grayed out or errors are reported.