Create Maven Subproject: Quick Guide

To create a subproject in Maven, you can follow these steps:

  1. Add the information of the sub-module in the parent project’s pom.xml file.
<modules>
    <module>子模块名称</module>
</modules>
  1. Create a directory with the same name as the submodule in the root directory of the parent project, and create the submodule’s pom.xml file in that directory.
  2. Define the basic information and dependencies of the module in the pom.xml file of the submodule, and then add the submodule to the parent project.
  3. Navigate to the root directory of the parent project in the command line and run the following command to build the submodules:
mvn clean install

This successfully creates a Maven subproject.

bannerAds