Run a local Bat command before deployment in IntelliJ IDEA

更新时间:
复制 MD 格式

This topic describes how to run a local BAT command before you deploy an application in IntelliJ IDEA.

Prerequisites

Cloud Toolkit is installed and configured. For more information, see Install and configure Cloud Toolkit in IntelliJ IDEA.

Procedure

  1. Open your project in IntelliJ IDEA.

  2. In the top menu bar of IntelliJ IDEA, choose Tools > Alibaba Cloud > Deploy to Host....

    Note

    You can deploy the application to various destinations, such as an ECS instance, SAE, DEAS, an image repository, or Mini Program Cloud. This topic uses Deploy to Host as an example.

  3. On the Deploy to Host page, click + to the right of the Before launch area, and then select Run External Tool.

  4. In the External Tools dialog box, click + in the upper-left corner.

  5. In the Create Tool dialog box, configure the parameters and click OK.

    The deployment parameters are as follows.

    Parameter

    Description

    Name

    A custom name for the tool.

    Group

    The group to which the tool belongs.

    Description

    A custom description for the tool.

    Tool Settings

    • Program: Specifies the executable file.

    • Arguments: The arguments to pass to the executable file.

    • Working directory: The path of the working directory for the tool.

    Advanced Options

    Advanced options that you can select as needed.

    Note

    Use spaces to separate parameters. Use double quotation marks for parameters and paths that contain spaces. Use a backslash to escape double quotation marks that are part of a parameter or path. For example: -Dmy.prop=\"quoted_value\" "second arg" third" "arg

  6. If your project uses Maven Build, move the configured step to run before the Maven Build step.

  7. Click Run to run your project.