新建SpringBoot工程
准备资料
POM文件中加入以下代码
1 <parent> 2 <groupId>org.springframework.boot</groupId> 3 <artifactId>spring-boot-starter-parent</artifactId> 4 <version>1.5.9.RELEASE</version> 5 <relativePath /> <!-- lookup parent from repository --> 6 </parent> 7 8 <properties> 9 <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 10 <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> 11 <java.version>1.8</java.version> 12 </properties> 13 14 <dependencies> 15 <dependency> 16 <groupId>org.springframework.boot</groupId> 17 <artifactId>spring-boot-starter-web</artifactId> 18 </dependency> 19 <dependency> 20 <groupId>org.springframework.boot</groupId> 21 <artifactId>spring-boot-starter-test</artifactId> 22 <scope>test</scope> 23 </dependency> 24 </dependencies>
Step 1: (2019/4/10 22:25:39) 用户在"Other... Ctrl+N (菜单项目)"上左键单击
Step 2: (2019/4/10 22:25:40) 用户在"&Next (按钮)"上左键单击(在"New"中)
Step 3: (2019/4/10 22:25:41) 用户在"&Next (按钮)"上左键单击(在"New"中)
Step 4: (2019/4/10 22:25:43) 用户在"&Next (按钮)"上左键单击(在"New"中)
Step 5: (2019/4/10 22:25:54) 用户在"Finish (按钮)"上左键单击(在"New"中)
工程创建成功!如果有报红,请updateMaven更新下就OK了;
创建Controller层
启动
启动成功后去浏览器上访问接口;springboot内置tomcat默认8080端口
OK一个简单的springboot工程创建成功!