Create Maven aggregation project in IDEA (best)

1: Create the parent project, file-new-project, check Create from archetype, and click next, because it is the parent project, do not check any of the following templates, and delete the corresponding src directory later, and only use it to manage the project And jar package

2: Write the corresponding GROUPID and ArtifactId, and you can decide by your own project

3: Select the previously created folder or create a new folder here, click Finish

3

4: built parent project

------------------------------Dividing line------------------ -----------------------------------------------

5: Create a subproject, right-click on the parent project, and do not select the template, because this submodule is used to provide external services without a web project

6: Choose to rely on the parent project, create one by yourself, the folder needs to be created under the parent project, click Finish

7: The project structure at this time, the pom of subproject 1 and the pom of the parent project

8: The same method for subproject 2 and subproject 1, but this requires web dependency

The project structure and the content of the parent Pom at this time

-----------------Dividing line------------------------------- ---

If subproject 2 depends on project 1, you can add it in pom

Test: Project 2 page

Project 1java:

Right-click View-Tool Windows-Mavenproject

Double-click the red one, if there is an error: Could not resolve dependencies for project, package the parent project

Configure tomcat

Select the war package you just made

run

The garbled code here is not done yet

 

Guess you like

Origin blog.csdn.net/CarryBest/article/details/84339784