src 源代码目录
├─main ├─main
│ ├─java │ ├─功能代码
│ │ └─package │ │ └─自定义的包
│ └─resources │ └─功能代码资源目录
└─test └─test
├─java ├─测试代码
│ └─package │ └─自定义的包
└─resources └─测试代码资源目录
pom.xml Maven的配置文件
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.domain-name.project-name</groupId>
<artifactId>module-name</artifactId>
<version>0.0.1-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<!--maven的版本-->
<modelVersion>4.0.0</modelVersion>
<!--项目的包名:公司网址反写+项目名-->
<groupId>com.moluo</groupId>
<!--模块名,建议项目名+模块名-->
<artifactId>girl</artifactId>
<!--项目版本:snapshot快照、release稳定、beta公测、GA正式发布-->
<version>0.0.1-SNAPSHOT</version>
<!--maven打包方式war、zip、pom-->
<packaging>jar</packaging>
<!--项目的描述名-->
<name>girl</name>
<!--项目描述-->
<description>Demo project for Spring Boot</description>
<url>项目地址</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
</properties>
<parent>
<!--继承父模块的pom-->
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.3.RELEASE</version>
<relativePath/>
</parent>
<dependencyManagement>
<!--不会在项目中运行,用于给子pom依赖-->
<dependencies>
</dependencies>
</dependencyManagement>
<dependencies>
<!--依赖的项目-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>2.0.3.RELEASE</version>
</dependency>
</dependencies>
<build>
<plugins>
<!--Maven插件-->
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
<modules>
<!--模块聚合,同时编译多个maven项目-->
<module></module>
</modules>
</project>
Maven插件 mvn archetype:genarate //maven自动建立目录骨架
<mirror>
<id>maven.net.cn (镜像仓库的id)</id>
<mirrorOf>central(为那个仓库配置镜像仓库)</mirrorOf>
<name>central mirror in china</name>
<url>http://maven.aliyun.com/nexus/content/groups/public(镜像仓库的url)</url>
</mirror>
<localRepository>/path/to/local/repo(本地仓库路径)</localRepository>