
zip包,将zip代码解压到自己指定的目录下使用idea或eclipse导入或生成 项目

修改gradle下载源【使用maven不需要】
在你的
Gradle项目中找到gradle/wrapper目录下的gradle-wrapper.properties文件
腾讯
distributionUrl=https://mirrors.tencent.com/gradle/gradle-{version}-bin.zip
修改 gradle 的 aliyun maven仓库
build.gradle文件中增加
//做全局配置
allprojects {
apply plugin: 'idea'
apply plugin: 'java'
tasks.withType(JavaCompile){
options.encoding = "UTF-8"
}
repositories {
mavenLocal()
maven {
url 'https://maven.aliyun.com/repository/public/'
}
mavenCentral()
}
}
编写test api
@RestController
@RequestMapping("/home")
public class HomeApi {
@GetMapping("/index")
public Map<String,String> home(){
String home = """
我是谁,我在那里,我要干什么?
努力,努力,世界,第一。
你好,你好,都是,老表。
""";
return Map.of("ok",home);
}
}
启动
初始化Git版本控制
增加.gitignore文件。自行添加,或者使用idea插件生成
bash git add . git commit -s -m "初始化项目" # git push