IDEA builds Spring Boot project

What is Spring Boot

Spring Boot is a new framework provided by the Pivotal team, which is designed to simplify the initial construction and development process of new spring applications. The framework uses a specific way to configure, so that developers no longer need to define a templated configuration. In this way, Spring Boot is committed to becoming a leader in the booming area of rapid application development


  1. Independent Spring applications can be created, and executable JARs and WARs can be created based on their Maven or Gradle plug-ins;
  2. Embedded Servlet containers such as Tomcat or Jetty;
  3. Provide automatically configured "starter" project object model (POMS) to simplify Maven configuration;
  4. Configure the Spring container as automatically as possible;
  5. Provide ready features such as metrics, health checks, and external configurations;
  6. Absolutely no code generation, no XML configuration required.


Environment and tools: JDK 1.8, Maven 3.0 +, IntelliJIDEA2018 (it is recommended to use idea to build and learn springboot, and idea is very friendly to audit and generate springboot)

Step 1: idea – file – new file – project; then select Next

Next: select project information; select next

Next: add support, select web, and click Next

Next: select the project name, click finish to complete the build, and wait for maven to add the required dependency package

pom file maven dependency

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="" xmlns:xsi=""
        <relativePath/> <!-- lookup parent from repository -->
    <description>Demo project for Spring Boot</description>






The start class of springboot, from which the project starts without tomcat configuration

Create a new controller
stay DemoApplication.class The new package or class will take effect

Use * * @ restcontroller in HellowController** ,@RestController=@Controller+@ResponseBody
Is returned in json format

Then start the project:

And the default port of tomcat embedded in springboot is 8080:

The replacement port needs to be Configure; and springboot supports the yml file format : (the properties file is written in the form of '.' points.)

application.yml : (the YML file is written in the format of ':' colon)

Default port: 8080
Change port: 8888

Start successfully! The springboot demo is complete. Springboot perfectly solves the requirements of various configuration files of spring before; it can be completed step by step. Chicken and vegetable peck at each other. Don't spray.

1. Blog content and form
This blog is a personal blog, which does not involve commercial use, only provides learning reference, and the content comes from personal original as well as Internet reprint and excerpt.
2. Copyright notice
Articles, pictures and documents with original logo on this blog shall not be used for commercial purposes or traditional media without my permission. Internet media or personal reprint please indicate the source and link, otherwise it is an infringement.

Never ask Qingfeng

Keywords: Spring Maven SpringBoot Tomcat

Added by phpfreakjav on Tue, 16 Jun 2020 07:11:02 +0300