Use maven to build springboot multi-module project in eclipse

There are many cases and articles on the Internet about how to use maven to build a springboot multi-module project. Here is just a record of the building process.

1. Create the parent project
File–>new–>maven project
write picture description here
Select the option on the way, click the next button, select pom
write picture description here
in the Packaging option, and click Finish.

2. Delete other files under the project, leave only pom.xml
write picture description here
right-click the project, maven->New Maven Module Project
write picture description here
fill in the module name, be careful not to check the Create a simple Project option at this time
write picture description here

write picture description here

After completion, the first module is created.

In the same way you can create a second module springboot-web
write picture description here

3.springboot-web depends on the springboot-common module

If the web module needs to call common module support, you can add common as a web dependency package.
Right-click springboot-web, Maven->Add Dependency, select common module
write picture description here

At this point, open the pom file of springboot-web and you can see:

write picture description here

Add other modules or dependencies in the same way.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325564319&siteId=291194637