只是簡單的構(gòu)建坛猪。
1.下載:從https://spring.io/projects/spring-boot --> Quick start 下載Demo.zip
2. 搭建:任意新建workplace import? Exiting Maven Projects誓沸。
3. 增加依賴:pom.xml下dependencies增加spring-boot-starter-web依賴。(run Maven install)
4. 添加測試代碼士嚎。
@RestController
public class HelloController {?
? ? @RequestMapping(value="/hello", method=RequestMethod.GET)?
? ? public String HelloController() {?
? ? ? ? return "Hello World!";?
? ? }?
}
5. 測試:http://localhost:8080/hello 正常就返回Hello World!。
sagan :一定要git clone 不要download.txt。
項目從官網(wǎng)跳轉(zhuǎn)github下載颖侄。
initializr:import所有,直接運行InitializrService享郊,成功后打 localhost:8080/ 會有網(wǎng)頁
注:
initializr
pom會報
Plugin execution not covered by lifecycle configuration:
io.spring.javaformat:spring-javaformat-maven-plugin:0.0.6:validate (execution: default, phase: validate)
不用管览祖。〈读穑可以直接運行展蒂,編輯器提示而已。