1、先創建一個maven專案,選擇quickstart

創建專案

2、在pom檔案中添加父專案
<!-- 父專案-->
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.6.2</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
3、對需要的jar包進行依賴
<!-- web-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
4、給啟動類添加注解SpringBootApplication,并且改寫main方法內的內容就可以了,

5、更改完成之后要將maven中自帶的test類洗掉

更多...
5、若需要更改配置則需要在main檔案夾下創建資源檔案夾,右鍵更改檔案夾型別為resources Root

6、在資源檔案夾內創建application.yml檔案,在其中配置資源
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/395435.html
標籤:其他
下一篇:動態資源(servlet)
