Maven目录结构
- maven约定的目录结构如下
- src文件夹
- main
- java // 程序功能代码
- resources // 资源代码,配置代码
- test // 测试代码
- java
- resources
- main
- pom.xml // 项目对象模型,与src文件夹
- target文件夹 // 编译后的文件,是Maven自动生成。
- src文件夹
pom.xml文件内容简介
- <groupId>域名反转,大项目名</groupId>:也是打包装载的路径。
- <artifactId>子模块名</artifactId>:项目名
- <version>版本<version>:项目版本
- 以上三个标签统称gav,在本地仓库里面唯一标识一个模块。
- <name>(和artifactId名一样)</name>
- <scope></scope>:依赖的范围,共三个。
- <properties></properties>。在这里面可以设置编码格式,统一版本。设置变量,类似于EL表达式子。方便版本管理。
- <dependencies><dependency>内容</dependency></dependencies>:在里面写入gav代替包的导入。