Publish the jar package to Alibaba cloud server with one click

Time:2021-4-21

Welcome to search for “little monkey’s technical notes” to pay attention to my official account, and I can communicate with me in time.

Most of the time, we need to compile, package, upload the package to the server, and start the jar package to release the jar package to the server. Although the operation is very simple, it is troublesome to repeatedly change the package, repeating many simple and useless actions.

Here we recommend an idea plug-in called “Alibaba cloud toolkit”, which can publish and run jar packages and other remote servers with one click. It’s just a click to release the project later. Isn’t it very convenient? Next, let’s see how to configure the plug-in!

1. First open the idea development tool, and then select “file” to find “Settings”.
Publish the jar package to Alibaba cloud server with one click
2. Then search “plugins” in the search box to find “marketplace”.
Publish the jar package to Alibaba cloud server with one click
    3 . Enter “Alibaba cloud toolkit”, and then click “Install” to install.
Publish the jar package to Alibaba cloud server with one click
4. After waiting for the installation to complete, click “OK” to prompt you to restart idea, and then click “restart”.
Publish the jar package to Alibaba cloud server with one click
Publish the jar package to Alibaba cloud server with one click

5. If you re-enter idea, you will be prompted. If you have the following prompt, the installation is successful, and then click “close”.
Publish the jar package to Alibaba cloud server with one click
6. Find “Alibaba Cloud View” in the lowest column of idea tool to configure the host.
Publish the jar package to Alibaba cloud server with one click
7. Click “add host” to add the host.
Publish the jar package to Alibaba cloud server with one click
8. Configure “host list” to represent host IP, and fill in “user name”: user name and “password”: password.
Publish the jar package to Alibaba cloud server with one click
Of course, you can also choose the private key to connect.
Publish the jar package to Alibaba cloud server with one click
    9 . After that, click “test connection” to test the connection. If “OK” appears, the configuration is successful.
Publish the jar package to Alibaba cloud server with one click
So far, the basic configuration has been completed. Next, I’ll simulate the effect of a springboot project automatically compiling, packaging, uploading and running.

@RestController
public class ToolController {

    @GetMapping("test")
    public String test(String msg) {
        return "hello: " + msg;
    }
}

Write a simple boot project, input an MSG and then prompt, the effect is as follows:
Publish the jar package to Alibaba cloud server with one click
Next, release this project to my alicloud. First, select tool to find “deploy to host”!
Publish the jar package to Alibaba cloud server with one click
Then set the name, which can be set at will. Then select the IP set before.
Publish the jar package to Alibaba cloud server with one click

You can choose more than one IP here. At present, I have only one IP. After selecting it, click “select”.
Publish the jar package to Alibaba cloud server with one click
After that, you need to set the directory where the jar package is uploaded, that is, the directory of the remote host, and set it in the “target directory”. After setting, you can select a script to operate on the jar. That is, select “select command“.
Publish the jar package to Alibaba cloud server with one click
If you have not written a command before, you can select “add command” to add the command.
Publish the jar package to Alibaba cloud server with one click
Here is a command to run the jar package in the background.
Publish the jar package to Alibaba cloud server with one click
You can also select the operation of Maven before running these commands, that is, what Maven needs to do before uploading the package. You can select the item and choose to fill in the Maven command.

Publish the jar package to Alibaba cloud server with one click
Then click “apply”. If you click “OK”, the command will be executed directly. If you don’t want to execute it directly, just click “apply”.
Publish the jar package to Alibaba cloud server with one click
If there is no problem with the configuration, you can first select the previously configured items, and then click the green triangle to run, and then pay attention to the console.
Publish the jar package to Alibaba cloud server with one click
There are two columns of prompts in the console. The first is the command result of Maven. Seeing “build success” means that the previously set command has been successful.
Publish the jar package to Alibaba cloud server with one click
The second is the result of uploading jar package and the command result executed after uploading.
Publish the jar package to Alibaba cloud server with one click
Open browser to access:
Publish the jar package to Alibaba cloud server with one click
Conclusion: This is a very powerful plug-in, which can save a lot of repetitive labor. However, today’s introduction is just the tip of the iceberg. It is recommended that you can go to the official website to find more treasures.

Alibaba cloud toolkit website:https://help.aliyun.com/produ…

Welcome to search for “little monkey’s technical notes” to pay attention to my official account, and I can communicate with me in time.