在eclipse 建立spring boot1.Eclipse中安裝STS外掛:Help -> Eclipse Marketplace…Search或選擇“Popular”標籤,選擇Spring Tool Suite (STS) for Eclipse外掛,安裝:2.New -> Project…找到Spring目錄,選擇Spring Starter Project,Next3、填寫跟專案相關的各種資訊,然後Next4.選擇需要的Dependency,然後Next:5.Next,然後Finsh,新專案就建立好了,各個目錄如下:6.右鍵MySpringBootApplication中的main方法,Run As -> Spring Boot App,專案就可以啟動了。package com.example;import org.springframework.boot.SpringApplication;import org.springframework.boot.autoconfigure.SpringBootApplication;@SpringBootApplicationpublic class MySpringBootApplication {public static void main(String[] args) {SpringApplication.run(MySpringBootApplication.class, args);}}12345678910111213由於選擇了web dependency預設啟動一個Tomcat,8080埠監聽7.把application.properties改名為application.yml(個人喜歡),修改Tomcat的啟動埠:server:port: 8081
在eclipse 建立spring boot1.Eclipse中安裝STS外掛:Help -> Eclipse Marketplace…Search或選擇“Popular”標籤,選擇Spring Tool Suite (STS) for Eclipse外掛,安裝:2.New -> Project…找到Spring目錄,選擇Spring Starter Project,Next3、填寫跟專案相關的各種資訊,然後Next4.選擇需要的Dependency,然後Next:5.Next,然後Finsh,新專案就建立好了,各個目錄如下:6.右鍵MySpringBootApplication中的main方法,Run As -> Spring Boot App,專案就可以啟動了。package com.example;import org.springframework.boot.SpringApplication;import org.springframework.boot.autoconfigure.SpringBootApplication;@SpringBootApplicationpublic class MySpringBootApplication {public static void main(String[] args) {SpringApplication.run(MySpringBootApplication.class, args);}}12345678910111213由於選擇了web dependency預設啟動一個Tomcat,8080埠監聽7.把application.properties改名為application.yml(個人喜歡),修改Tomcat的啟動埠:server:port: 8081