Deploy multi-module projects
The toolkit-maven-plugin supports two ways to deploy submodules from a Maven multi-module project: from the parent project directory or from a submodule directory.
Prerequisites
Before you begin, make sure that you have:
toolkit-maven-plugin added to your project
A valid
.edas_config.yamlin each submodule that maps to an EDAS application(Method 1 only) toolkit-maven-plugin V1.0.3 or later
Choose a deployment method
| Method | Deploy from | Version requirement | Best for |
|---|---|---|---|
| Deploy from the parent project | Parent project directory | V1.0.3 or later | Deploying multiple submodules in a single command |
| Deploy from a submodule | Submodule directory | All versions | Deploying a single submodule independently |
Method 1: Deploy from the parent project
Run the toolkit:deploy goal from the parent project directory with the -Ddeploy_artifacts parameter to specify which submodules to deploy by artifact ID.
Example
Consider a project named CarShop with this structure:
carshop/
itemcenter-api/
itemcenter/
.edas_config.yaml
detail/
.edas_config.yamlTo deploy the itemcenter and detail submodules, run the following command in the carshop directory:
mvn clean package toolkit:deploy -Ddeploy_artifacts=itemcenter,detailSeparate multiple artifact IDs with commas. The plug-in reads each submodule's .edas_config.yaml and deploys to the corresponding EDAS application.
To specify a custom configuration file instead of the default .edas_config.yaml, add the -Dedas_config parameter:
mvn clean package toolkit:deploy -Ddeploy_artifacts=itemcenter,detail -Dedas_config=<path-to-config-file>Replace <path-to-config-file> with the path to your configuration file.
Method 2: Deploy from a submodule
This method works with all toolkit-maven-plugin versions. Use it when you need to deploy a single submodule or when you cannot upgrade to V1.0.3.
In the parent project directory, install all submodule dependencies to the Maven local repository:
mvn installGo to the target submodule directory and run the deployment goal: Replace
<submodule-directory>with the name of the submodule directory, such asitemcenterordetail.cd <submodule-directory> mvn toolkit:deploy
For more information about deploying multi-module projects in EDAS, see Deploy a submodule in a multi-module project using IntelliJ IDEA and Deploy a submodule in a multi-module project using Eclipse.