新建SpringBoot工程
新建SpringBoot工程
准备资料
POM文件中加入以下代码
<parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.1.0.RELEASE</version> <relativePath /> <!-- lookup parent from repository --> </parent> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <java.version>1.8</java.version> </properties> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> </plugins> </build>
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工程创建成功!
以上内容原创来自每特学院,每特学员学习并整理!
给学院打波广告:
http://www.mayikt.com/