- 环境准备
- 开始
- 项目初始目录结构
- 运行
- 遇到的问题
windows环境
- intellij idea ultimate 2018.1
- jdk1.8
- springboot 2.6.7
默认,不选择任何依赖,springboot版本为2.6.7
点击finish
1.mainjavacomfqcheng220helloworldspringbootHelloworldSpringbootApplication.java
package com.fqcheng220.helloworldspringboot;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class HelloworldSpringbootApplication {
public static void main(String[] args) {
SpringApplication.run(HelloworldSpringbootApplication.class, args);
}
}
2.main/resources/application.properties文件内容初始为空
3.pom.xml
运行4.0.0 org.springframework.boot spring-boot-starter-parent2.6.7 com.fqcheng220 helloworld-springboot0.0.1-SNAPSHOT helloworld-springboot Demo project for Spring Boot 1.8 org.springframework.boot spring-boot-starterorg.springframework.boot spring-boot-starter-testtest org.springframework.boot spring-boot-maven-plugin
maven自动导入pom配置的依赖,完成后,点击绿色三角run,运行ok
本机pom嵌套依赖下载失败
解决方案:m2缓存里删除对应包,重新在maven project侧边窗口点击refresh下载依赖



