Create a Maven multi-module project with Eclipse

1 Create the parent project

  1. Inside Eclipse New ->other ->Maven ->Maven Project 点击下一步
  2. Select "Create a simple project" in the pop-up interface

 

 

 

 

2 Create a project

  1. Inside Eclipse New ->other ->Maven ->Maven Module 点击下一步
  2. 输入模块项目名
     

     
  3. This project is a public module project here archetype I choose quickstart



 

 

 

Try zwp-parent's pom.xml below. You can see that the module project zwp-common is included



 

Let's try zwp-common's pom.xml to remove the two lines of code that warn.



 

 

3 Create another web module project in the same way



 

Here we archetype choose webapp

 

 

 

4 Add dependencies

Since zwp-web depends on the zwp-common project, we need to import it.

  1. First, add the following project.version to the pom.xml file of zwp-parent to control the version number
    of the project. The following ellipse contains the dependencies required by the other two files. Put this dependency package in the pom.xml
    file of zwp-parent, and the other two can be removed and referenced.

     
  2. zwp-common pom.xml

     
  3. zwp-web pom.xml

     
  4. After completing the above, you can see the zwp-web maven dependency

     

you're done

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326845747&siteId=291194637