-src -main -java -包名 启动类 业务代码:需要放在启动类同级包下或者子包下 -resources -static 存放静态资源 -templates 存放模板页面 application.properties SpringBoot提供的唯一配置文件 -test 测试相关 .gitignore 默认忽略一些文件和目录的文件 pom.xml maven依赖信息
其中:pom.xml文件
<!--父工程:指定当前工程为SpringBoot工程;声明了starter依赖相关版本--> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.4.2</version> <relativePath/> <!-- lookup parent from repository --> </parent> <!--项目元数据:包名、项目名、版本号--> <groupId>com.shiory</groupId> <artifactId>springboot-demo01</artifactId> <version>0.0.1-SNAPSHOT</version> <name>springboot-demo01</name> <description>Demo project for Spring Boot</description> <!--properties信息:指定了Java版本--> <properties> <java.version>15</java.version> </properties> <!--默认导入的依赖--> <dependencies> <!--web项目相关依赖--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <!--测试相关依赖--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency> </dependencies> <!--SpringBoot版本的maven插件--> <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> </plugins> </build>
02-SpringBoot默认的目录结构
猜你喜欢
转载自blog.csdn.net/zhuzbYR/article/details/112796471
今日推荐
周排行