jdk版本:“1.8.0_171”,maven版本:3.8.6。

地址:https://github.com/spring-projects/spring-boot/tags
2.2.9.RELEASE,2.3.0以上版本需要用gradle构建,会比较麻烦。


跳过测试,能节省很多时间。
mvn clean install -DskipTests

时间可能会很长。
This failure was cached in the local repository and resolution is not reattempted until the update interval of nexus-aliyun has elapsed or updates are forced. Original error: Could not transfer artifact。
This failure was cached in the local repository and resolution is not reattempted until the update interval of nexus-aliyun has elapsed or updates are forced. Original error: Could not transfer artifact。
不要使用阿里云仓库,否则一些依赖下载不到会报错,
用maven自带的setting.xml。
Failed to execute goal io.spring.javaformat:spring-javaformat-maven-plugin:0.0.22:validate (default) on project spring-boot-test-support: Formatting violations found in the following files。
Failed to execute goal io.spring.javaformat:spring-javaformat-maven-plugin:0.0.22:validate (default) on project spring-boot-test-support: Formatting violations found in the following files。

先运行:
mvn spring-javaformat:apply

然后再打包。



这样是为了方便我们debug调试。






修改spring-boot-mytest的springboot版本号为:‘2.2.9.RELEASE’。

添加module。



package com.duohoob.springbootmytest.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class TestController {
@RequestMapping("/test")
public String test() {
return "springboot源码环境搭建完成。";
}
}
选中模块→src/main/java→sources。


http://localhost:8080/test
