All Products
Search
Document Center

Serverless App Engine:Use the Alibaba Cloud Toolkit for Eclipse plug-in to deploy an application

Last Updated:Sep 03, 2024

To deploy applications in Serverless App Engine (SAE), you can use the SAE console or the Alibaba Cloud Toolkit for Eclipse plug-in. This topic describes how to use the Alibaba Cloud Toolkit for Eclipse plug-in to deploy an application.

Prerequisites

Background information

Alibaba Cloud Toolkit is a free integrated development environment (IDE) plug-in provided by Alibaba Cloud. You can create an Alibaba Cloud account or use an existing Alibaba Cloud account to download and install Alibaba Cloud Toolkit in IntelliJ IDEA for free.

After you develop, debug, and test your application in your data center, you can use the Alibaba Cloud Toolkit plug-in to deploy the application in SAE.

Install Alibaba Cloud Toolkit

  1. Start Eclipse.
  2. In the top navigation bar, choose Help > Install New Software.
  3. In the Available Software dialog box, enter the following Alibaba Cloud Toolkit for Eclipse URL in the Work with field: http://toolkit.aliyun.com/eclipse/. Then, press the Enter key.
  4. Configure components.
    Configure Alibaba Cloud Toolkit components - Eclipse
    1. In the type filter text list, select the required components.
    2. In the Details section, clear Contact all update sites during install to find required software.
    3. Click Next.
  5. Perform the subsequent steps as prompted on the installation page of Eclipse.
    Important If a message indicating that no digital signature exists appears, select Install anyway.
  6. Restart Eclipse.

    After you install the Alibaba Cloud Toolkit plug-in, restart Eclipse. Then, you can view that the Alibaba Cloud Toolkit icon is displayed in the toolbar.

    Alibaba Cloud Toolkit is installed

Configure an Alibaba Cloud Toolkit account

When you use Alibaba Cloud Toolkit to deploy applications to Alibaba Cloud, you must call the API operations of Alibaba Cloud services. When you call the API operations, you must use an AccessKey pair that consists of an AccessKey ID and an AccessKey secret for authentication in the cloud. Therefore, before you deploy applications, configure account information in Alibaba Cloud Toolkit.

  1. Obtian an AccessKey pair.
  2. Start Eclipse.
  3. In the top navigation bar, choose Windows > Preferences.
  4. In the left-side navigation pane of the Preferences page, choose Alibaba Cloud Toolkit > Accounts.
  5. On the Accounts page, configure the Access Key ID and Access Key Secret parameters and click Apply and Close.
    Accounts

Deploy an application to SAE

Alibaba Cloud Toolkit allows you to deploy applications to SAE by using WAR packages, JAR packages, or images.

  1. In the Package Explorer section on the left side of the Eclipse page, right-click the name of your application project and choose Alibaba Cloud > Deploy to SAE....
  2. In the Deploy to SAE dialog box, configure the Region, Namespace, and Application parameters based on your business requirements and configure the deployment method.
    Note If you have not created an application in the SAE console, click Create Serverless Application on SAE console in the upper-right corner of the dialog box to go to the SAE console.

    The following table describes the deployment parameters.

    ParameterParameterDescription
    ApplicationRegionThe region where the application resides.
    NamespaceThe namespace to which the application belongs.
    ApplicationThe name of the application.
    Deploy FileMaven BuildIf you select Maven Build to build the application, the system adds a Maven job to build the deployment package.
    Upload FileIf you select Upload File to build the application, upload your WAR package or JAR package and then deploy the application.
    Image AddressIf you select Image to build the application, enter an image address and then deploy the application.
    Note If you use a JAR package or a WAR package to deploy an application in the SAE console, you can select only Maven Build or Upload File when you use Alibaba Cloud Toolkit to deploy the application. If you use an image to deploy an application in the SAE console, you can select only Image when you use Alibaba Cloud Toolkit to deploy the application.
  3. After you configure the settings, click Deploy.
    • After the deployment process starts, Eclipse prints deployment logs in the Console section. You can view the logs to check whether the deployment is successful.
    • You can log on to the SAE console and view the change records of the application on the Change Records page.

Stop the Alibaba Cloud Toolkit plug-in

If you want to run other plug-ins when the Alibaba Cloud Toolkit plug-in is running, stop the SAE-deploy process on the Progress page.

Deploy a multi-module project

In most cases, a project consists of multiple modules. You can use the toolkit-maven-plugin plug-in to deploy your multi-module project by using one of the following methods:
  • Method 1: Run the packaging and deployment commands in your parent project.

    To use this method, you must use toolkit-maven-plugin V1.0.3 or later.

    When you run the toolkit:deploy command in your parent project, add the -Ddeploy_artifacts parameter to specify the artifact ID of the submodule that you want to deploy. If you want to deploy multiple submodules, separate them with commas (,).

    The following example shows the submodules of the CarShop project:

    carshop
       itemcenter-api
       itemcenter
    
       detail

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

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

    By default, the plug-in separately deploys the corresponding applications based on the .edas_config.yaml files of the itemcenter and detail submodules. You can also add the -Dedas_config parameter to specify the configuration file.

  • Method 2: Run the packaging and deployment commands in your submodule. All the toolkit-maven-plugin versions support this method.

    Run the install command in your parent project to install the dependencies of the submodule to your Maven local repository. Then, go to the directory of the submodule that you want to deploy and run the toolkit:deploy command.

References

Operation

References

Lifecycle management operations, such as updating, starting, stopping, and deleting an application, and scaling in or scaling out the instances for an application

Manage the lifecycle of an application

Performance optimization operations, such as configuring auto scaling policies for an application, binding Server Load Balancer (SLB) instances to an application, and starting or stopping applications in batches

Application status-based operations, such as managing logs, configuring monitoring settings, viewing application events, and viewing change records