Deploy multi-module projects

Updated at:

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.yaml in each submodule that maps to an EDAS application

  • (Method 1 only) toolkit-maven-plugin V1.0.3 or later

Choose a deployment method

MethodDeploy fromVersion requirementBest for
Deploy from the parent projectParent project directoryV1.0.3 or laterDeploying multiple submodules in a single command
Deploy from a submoduleSubmodule directoryAll versionsDeploying 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.yaml

To deploy the itemcenter and detail submodules, run the following command in the carshop directory:

mvn clean package toolkit:deploy -Ddeploy_artifacts=itemcenter,detail

Separate 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.

  1. In the parent project directory, install all submodule dependencies to the Maven local repository:

       mvn install
  2. Go to the target submodule directory and run the deployment goal: Replace <submodule-directory> with the name of the submodule directory, such as itemcenter or detail.

       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.