Use IDEA for project programming. It involves maven for parent-child module projects.
1. Create a new project: file—->new—>project
2. The steps are as shown in the figure:
3. Fill in the company name and project name
4. The created new project is as shown in the figure:
5. Because the newly created project is the maven parent template, the src directory in it can be deleted. In fact, the parent project is an empty directory (understand by yourself)
6. Right-click on the selected project—>new—>module
7. Add templates for sub-projects, which can be added or not added according to the actual situation
8、
9、
10. Be sure to fill in the correct file directory here, otherwise an error will be reported that pom.xml already exists, and the sub-template creation fails
11. Click FINISH, and the entire project is now created. If you want to add other sub-templates, just follow these steps
12. Open the sub-template file directory and find that they are all non-functional packages. You need to define the type . 13. You may find that there is no Java package, and you can create a new one. Create a new Java package and define the type as shown in the figure below ①, create a new module ②, define the type
14. Define the directory style after the type is completed
1. Create a new project: file—->new—>project
2. The steps are as shown in the figure:
3. Fill in the company name and project name
4. The created new project is as shown in the figure:
5. Because the newly created project is the maven parent template, the src directory in it can be deleted. In fact, the parent project is an empty directory (understand by yourself)
6. Right-click on the selected project—>new—>module
7. Add templates for sub-projects, which can be added or not added according to the actual situation
8、
9、
10. Be sure to fill in the correct file directory here, otherwise an error will be reported that pom.xml already exists, and the sub-template creation fails
11. Click FINISH, and the entire project is now created. If you want to add other sub-templates, just follow these steps
12. Open the sub-template file directory and find that they are all non-functional packages. You need to define the type . 13. You may find that there is no Java package, and you can create a new one. Create a new Java package and define the type as shown in the figure below ①, create a new module ②, define the type
14. Define the directory style after the type is completed
New sub-projects can be viewed https://blog.csdn.net/chushoutaizhong/article/details/80018628
Original https://blog.csdn.net/shyuan128/article/details/78248240