1. Create a maven project (next next next)
2. Install JBLJavaToWeb plug-in
file->setting->plugins
search JBLJavaToWeb
3. Right-click the project name, click JBLJavaToWeb
effect: webapp package added
4.file -> Build, Execution , Deployment -> Build Tools 下的 Maven Runner
VM in the small box on the right (plus the following sentence, if the local warehouse does not have a dependent package, crawl it from a distance):
-DarchetypeCatalog=internal -Dfile.encoding=UTF-8
5. Bring these two sentences in pom.xml
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.7.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
</dependencies>
6. Build a com package under java, and then build a startup class
package com;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
//三个注解的合并注解
@SpringBootApplication
public class Ling {
//主函数启动
public static void main(String[] args) {
//启动方法
SpringApplication.run(Ling.class,args);
}
}