Deploy a submodule of a multi-module project in IntelliJ IDEA

Updated at:

Cloud Toolkit lets you deploy a submodule from a multi-module project. This topic describes how to deploy the Consumer submodule of a Meetup multi-module project to Serverless App Engine (SAE) in IntelliJ IDEA.

Background information

If you have a Meetup multi-module project, it has the following structure:

  • Consumer

  • Provider

  • Provider-api

The Consumer and Provider modules are submodules of the Meetup project. Both modules depend on the Provider-api module.

Deploy a submodule of a multi-module project

  1. In the Project view of IntelliJ IDEA, right-click the Meetup project. From the shortcut menu, select Alibaba Cloud > Deploy to SAE....

  2. In the Deploy to SAE dialog box, set the deployment parameters.

    Note

    If you have not created an application in SAE, click Create Serverless Application on SAE Console in the upper-right corner of the dialog box to open the SAE console and create an application.

    The following table describes the deployment parameters.

    Parameters

    Parameter

    Description

    Application

    Region

    The region where the application is located.

    Namespace

    The namespace where the application is located.

    Application

    The name of the application.

    Deploy File

    Maven Build

    If you select this option, the system adds a Maven task by default to build the deployment package. To deploy a submodule of a multi-module project, see Deploy a submodule of a multi-module project.

    Upload File

    If you select this option, upload your WAR or JAR package to deploy the application.

    Image

    If you choose the Image method to build an application, you must enter a registry address before you can deploy it.

    Gradle Build

    If you select this option, you can build and deploy the application directly.

    Note

    If you deployed the application from a JAR or WAR package, you can only use the Maven Build or Upload File deployment methods in Cloud Toolkit. If you deployed the application from an image, you can only use the Image deployment method.

  3. Run the mvn clean install command on the Meetup parent project. This is the default action.

  4. Run the mvn clean package command on the Consumer subproject.

    1. In the Deploy to EDAS dialog box, in the Before launch area, you can click +.

    2. From the Add New Configuration menu, select Run Maven Goal.

    3. In the Select Maven Goal dialog box, click the folder icon to select the Consumer submodule, in the Command line field, enter clean package, and then click OK.

  5. Click Apply, and then click Run.

Result verification

After the deployment starts, deployment logs appear in the Console section of IntelliJ IDEA. You can check the logs to verify the deployment result.

You can also log on to the SAE console to view the deployment result on the application's basic information page.