First, install the plug
Ensure IntelliJ IDEA version 2018.1 or later
Open Settings - Plugins search installation Alibaba Cloud Toolkit
Second, configure the environment
Deploy to Host: any server
The other is the support of Ali cloud. More.
But Deploy to Host function feeling has been good enough.
Because the company's projects, using IDEA comes packaged MAVEN often go wrong,
Use Maven Build package will be reported srcPath does not exist, can not find the file, the reason is because Cloud Toolkit default target directory to find the version and packaging according to artifactId and spliced into a project name.
Since the package is not convenient to directly change the path of the generated address, so I changed Upload File upload files.
File: Select the address of the local host file.
IP: upload server, you can select more than one at the same time.
Target Directory: uploaded to the server file path
Command: complete command after the server performs the upload.
Command is as follows:
ps aux | grep "test.jar" |grep -v grep| cut -c 9-15 | xargs kill -9; nohup java -jar test.jar >> ./logs/test.out 2>&1 &
To kill the current server named test.jar service, and then start the service.
Before launch: local command executed before uploading. You can configure package command.
clean package -Dmaven.test.skip=true -DprofileActive=test -f pom.xml
Third, packaged and uploaded to the server to start
1, run plug-ins
Because the configuration of the start command, there is no need to switch to a terminal window starts.
Fourth, experience
Alibaba Cloud Toolkit plug-in can really reduce the number of repeat operation deployment. Easy deployment test in a test environment.
减少了 以前 打包,上传,命令停止,命令启动。插件启动一下全搞定。
2019/07/24 13:46
参考: