Deploy a submodule in a multi-module project using Eclipse

更新时间:
复制 MD 格式

You can use Cloud Toolkit to deploy a submodule from a multi-module project. This topic describes how to deploy the Consumer submodule of a Meetup project to Serverless App Engine (SAE) from Eclipse.

Background information

Assume you have a Meetup multi-module project with 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. Run the mvn clean install command on the parent Meetup project. You can use one of the following methods:
    • In the Project Explorer pane on the left, right-click the Meetup project and select Run As > Maven install from the shortcut menu.maven install
    • Change the directory to your Meetup project folder and run the mvn clean install command.
  2. Run the mvn clean package command on the Consumer submodule.
    1. In the Project Explorer pane on the left, right-click the Consumer project and select Alibaba Cloud > Deploy to SAE... from the shortcut menu.
    2. In the Deploy to SAE dialog box, configure the deployment parameters. In the Maven Config section, enter clean package in the Goals
      deploy to sae
      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.

      Parameter Parameter Description
      Application Information Region The region where the application is located.
      Namespace The namespace where the application is located.
      Application The name of the application.
      Deployment Method Maven Build The Maven Build method lets you directly build and deploy an application.
      Upload File Uploads a WAR or JAR package for deployment.
      Image Address Deploys the application from a specified image address.
      Note If you deployed your application using a JAR or WAR package, you can use only the Maven Build or Upload File deployment methods in Cloud Toolkit. If you deployed your application using an image, you can use only the Image deployment method.
    3. Click Deploy.

Verify the results

After the deployment starts, deployment logs appear in the Console pane in Eclipse. Check the logs to verify the deployment.

You can also log on to the SAE console to view the deployment status on the basic information page of the application.