Spring Boot is a light-weight framework that allows you to create independent, production-level, Spring-based, and out-of-box applications. This topic describes how to develop a simple Spring Boot application and deploy the application in Web+.

Prerequisites

Before getting started, you must make sure that the following tools are installed and configured.

Step 1: Create a Demo project

  1. Start IntelliJ IDEA.
  2. Choose File > New > Project to create a new project.
  3. You need to configure the project and complete the creation.
    1. In the left-side navigation pane, click Spring Initializr and click Next.
    2. You need to configure the required project settings. After the configuration is complete, click Next.
    3. On the Dependencies page, click Web, select Spring Web Starter, and then click Next.
    4. Enter a project name and click Finish to complete the creation procedure.
    5. Open the pom.xml file in the project directory, and add the code shown in the rectangular box of the following figure to the file.

Step 2: Configure an application

  1. Create a new controller.
  2. Click Debug to start the application.
  3. Enter the address shown in the following figure in the address bar of your browser to access the application.

Step 3: Build an executable JAR file

  1. Click the Maven tab and click Execute Maven Goal. In the Execute Maven Goal dialog box, enter package in the Command line field, and click Execute.
  2. After you archive the project, a JAR package is created in the target directory of the project, for example, demo-0.0.1-SNAPSHOT.jar. Then, you need to deploy the application in Web App Service.

Step 4: Create and deploy an application

  1. Log on to the Web+ console.
  2. On the Overview page, click Create in the upper-right corner of the Last Updated Deployment Environments section.
  3. In the Basic Information step, select Java in the Technology Stack Type field and enter an application name and description. After the configuration is complete, click Next.
  4. In the Environment Information step, enter a environment name, select Upload Local Application in the Deployment Package Source field, and upload the demo-0.0.1-SNAPSHOT.jar deployment package. After configuring the deployment package version, click Creation Complete.
  5. In the Finish step, click View Application or Creation Complete to go to the Overview tab of the Application Details page. Click the name of a deployment environment to go to the Overview tab of the Deployment Environment Details page. Then, click the link next to the Public IP Address tab to view the homepage of the application.

More information