Note/JAVA/Springboot/1.SpringBoot之项目文件作用.md

54 lines
2.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

## SpringBoot之项目文件作用
下面是一张SpringBoot的项目文件图其中项目是由`.mvn`、`src`、`target` 文件夹和`.getignore`、`HELP.md`、`mvnw`、`mvnw.cmd`、`pom.xml`、`untitled.iml`组成。(此项目是包含四个模块,模块均相同,不影响文件功能)
![image-20230301205134729](https://lsky.hhdxw.top/imghub/img/image-20230301205134729.png)
### 1、.mvn
`.mvn`是Spring Boot 生成,用于一键通过 **Maven**构建、编译、打包和部署的文件目录。内部结构如下:
![image-20230301205529767](https://lsky.hhdxw.top/imghub/img/image-20230301205529767.png)
### 2、src
![image-20230301205636397](https://lsky.hhdxw.top/imghub/img/image-20230301205636397.png)
```
├── main
│ ├── java
│ │ └── com.yv --- package包名
│ └── resources --- 资源目录
│ ├── static --- 静态资源、js、css等
│ ├── templates --- html前端页面文件等
│ └── application.properites --- spring的配置文件
└── test --- 单元测试所在的目录
```
### 3、target
应用构建时生成,主要存放了源代码编译后的 class 文件,相关的配置文件以及打好的包文件等用于实际执行的文件。
![image-20230301210547502](https://lsky.hhdxw.top/imghub/img/image-20230301210547502.png)
### 4、.getignore
`.gitignore`文件用来忽略被指定的文件或文件夹的改动,被记录在`.gitignore`文件里的文件或文件夹是无法被git跟踪到的即被忽略的文件是不会被放入到远程仓库里的。如果文件已经存在于远程仓库中是无法通过`.gitignore`文件来忽略的。
### 5、HELP.md
项目的帮助文档,比如可以写一些项目架构的说明等内容,删除对项目运行没有影响。
### 6、mvnw和mvnw.cmd
`mvnw`和`mvnw.cmd`有相同的职责,引导.mvn/wrapper/maven-wrapper.jar下载Maven二进制文件mvnw用于Linux系统mvnw.cmd用于Windows系统
### 7、pom.xml
maven的配置文件我们需要依赖的jar包都在这里面配置并下载使用。
### 8、untitled.iml
iml(infomation of module)也就是模块信息。它是我们项目的配置文件存储一些模块配置信息比如Maven组件、模块路径信息。