Deploy Spring Boot or Spring Cloud Applications to Alibaba Cloud in Eclipse

Develop an Application Locally

package com.aliyun.toolkit.demo;import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class HelloWorldController {

@RequestMapping("/")
public String sayHello() {
return "Alibaba Cloud Toolkit: Hello,World.";
}
}
package com.aliyun.toolkit.demo;import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class Startup {

public static void main(String[] args) {
SpringApplication.run(Startup.class,args);
}
}

Install a Plug-in

Configure the Plug-in Preferences

Deploy the Application

Description of Deployment Parameters:

  • Deploy File: Two options are available.
  • Maven Build: If Maven is used to build the current project, you can use Alibaba Cloud Toolkit to directly build and deploy the application.
  • Upload File: If Maven is not used to build the current project, or a locally packaged deployment file already exists, you can select and directly upload the local deployment file.
  • Target Deploy ECS: Select a region from the drop-down list, and then select the ECS instance to be deployed in the region.
  • Deploy Location: Enter the deployment path on the ECS instance, for example, /root/springbootdemo.
  • Command: Enter the application startup command, for example, sh /root/springbootdemo/restart.sh. This is the command to be executed after the application package is deployed. For a Spring Boot program, this is usually a startup command: java -jar XXXX.jar.
source ~/.bash_profile
killall java
nohup java -jar /root/springbootdemo/springbootdemo-0.0.1-SNAPSHOT.jar > nohup.log 2>&1 &

Original Source

--

--

--

Follow me to keep abreast with the latest technology news, industry insights, and developer trends. Alibaba Cloud website:https://www.alibabacloud.com

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Alibaba Cloud

Alibaba Cloud

Follow me to keep abreast with the latest technology news, industry insights, and developer trends. Alibaba Cloud website:https://www.alibabacloud.com

More from Medium

Elasticsearch REST Java Client

The What, Why, and How of Implementing Microservices Architecture on AWS

Microservices

Deploying a Java application to Elastic Beanstalk by using GIT, CodeBuild, CodePipeline(CI/CD)

Introduction to Microservices